Wraith. Newsletter
(Wraith v0.1.0)
View Source
Everything that goes out by mail, built with Swoosh and sent through
Wraith.Mailer:
send_welcome/1— when a member signs upsend_login_link/1— a magic sign-in link (Wraith.Tokens:member_login)send_post/2— a published post to every subscribed member, in batches of 50 with a per-member unsubscribe link; records the send on the post (NEWSLETTERitem) so it goes out oncesend_password_reset/1— for authors (Wraith.Accounts)
Mail is plain HTML built here (no template engine): the post body is the rendered Markdown with widgets replaced by a link to the live page.
Summary
Functions
Double opt-in: the link that turns a sign-up into a subscriber.
Mail a published post to every subscribed member who may read it (paid
posts go to paid members only). Returns {:ok, count}; {:error, :already_sent}
the second time unless force: true.
Someone replied to a member's comment.
Mail a post (any status) to one author as a test; nothing is recorded.
Has this post gone out as a newsletter?
Functions
Double opt-in: the link that turns a sign-up into a subscriber.
Mail a published post to every subscribed member who may read it (paid
posts go to paid members only). Returns {:ok, count}; {:error, :already_sent}
the second time unless force: true.
Someone replied to a member's comment.
Mail a post (any status) to one author as a test; nothing is recorded.
Has this post gone out as a newsletter?