z_email_server (zotonic_core v1.0.0-rc.10)
Link to this section Summary
Functions
Handle a bounce
Convert process state when code is changed
Handle a delivery report from an outside service like mailgun
Generate a new message id
Send an e-mail.
Poll the database queue for any retrys.
Initiates the server.
Check if the received e-mail address is a bounce address
Check if the sender is allowed to send email. If an user is disabled they are only allowed to send mail to themselves or to the admin.
Check if a file is a tempfile of the emailer
Return the max age of a tempfile
Force a poll to send new email
Send an email
Send an email using a predefined unique id.
Starts the server
Return the filename for a tempfile that can be used for the emailer
This function is called by a gen_server when it is about to terminate. It should be the opposite of Module:init/1 and do any necessary cleaning up. When it returns, the gen_server terminates with Reason. The return value is ignored.
Link to this section Types
Link to this type
delivery_type/0
-type delivery_type() :: permanent_failure | temporary_failure | sent | received | relayed.
Link to this section Functions
Link to this function
bounced(Peer, NoReplyEmail)
Link to this function
code_change(OldVsn, State, Extra)
Link to this function
delivery_report(What, OptRecipient, MsgIdHeader, OptStatusMessage)
-spec delivery_report(delivery_type(), binary() | undefined, binary(), binary() | undefined) -> ok.
Link to this function
generate_message_id()
-spec generate_message_id() -> binary().
Link to this function
get_email_from(Context)
-spec get_email_from(z:context()) -> binary().
Link to this function
handle_call(Message, From, State)
Link to this function
handle_cast(Message, State)
Link to this function
handle_info(Info, State)
Link to this function
init(Args)
Link to this function
is_bounce_email_address(_)
Link to this function
is_recipient_blocked(Recipient, Context)
Link to this function
is_sender_enabled(Email, Context)
Link to this function
is_sender_enabled(Id, RecipientEmail, Context)
Link to this function
is_tempfile(File)
Link to this function
is_tempfile_deletable(File)
Link to this function
poll()
-spec poll() -> ok.
Link to this function
send(Email, Context)
Link to this function
send(EmailId, Email, Context)
Link to this function
start_link()
-spec start_link() -> {ok, pid()} | ignore | {error, term()}.
Link to this function
tempfile()
Link to this function