Skip to content

Commit

Permalink
Clarify when to close the log file (#1500)
Browse files Browse the repository at this point in the history
  • Loading branch information
angelikatyborska authored Jul 5, 2024
1 parent 587f44e commit e721afd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion exercises/concept/newsletter/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Newsletter.close_log(pid)

Now that you have all of the building blocks of the email sending procedure, you need to combine them together in a single function.

Implement the `Newsletter.send_newsletter/3` function. It should take a path of the file with email addresses, a path of a log file, and an anonymous function that sends an email to a given email address. It should read all the email addresses from the given file and attempt to send an email to every one of them. If the anonymous function that sends the email returns `:ok`, write the email address to the log file, followed by a new line. Make sure to do it as soon as the email is sent. Afterwards, close the log file.
Implement the `Newsletter.send_newsletter/3` function. It should take a path of the file with email addresses, a path of a log file, and an anonymous function that sends an email to a given email address. It should read all the email addresses from the given file and attempt to send an email to every one of them. If the anonymous function that sends the email returns `:ok`, write the email address to the log file, followed by a new line. Make sure to do it as soon as the email is sent. After all sending is done, close the log file.

```elixir
Newsletter.send_newsletter(
Expand Down

0 comments on commit e721afd

Please sign in to comment.