exercism/elixir/newsletter/HINTS.md

1.6 KiB

Hints

1. General

1. Read email addresses from a file

2. Open a log file for writing

  • There is a built-in function for opening a file.
  • The second argument of that function is a list of modes which allows specifying that the file should be opened for writing.

3. Log a sent email

  • Functions for reading and writing to a file opened with File.open!/1 can be found in the IO module.
  • There is a built-in function for writing a string to a file, followed by a newline.

4. Close the log file

5. Send the newsletter

  • All the necessary operations on files were already implemented in the previous steps.
  • Before writing to a file, the file must be opened.
  • After all write operations to a file finished, the file should be closed.