Module m_email_status

Model for registering the status per email recipient.

Copyright © 2015-2018 Marc Worrell

Behaviours: zotonic_model.

Authors: Marc Worrell (marc@worrell.nl).

Description

Model for registering the status per email recipient.

Function Index

block/2
clear_status/2
clear_status/3Clear the status of the email address.
get/2Fetch the stats from an email address.
install/1Install the email tracking table.
is_ok_to_send/2Check if an email address is known to be valid, if nothing known then assume it is valid.
is_valid/2Check if an email address is known to be valid, if nothing known then assume it is valid.
m_get/3Fetch the value for the key from a model source.
mark_bounced/2Mark as bounced, this is handled as permanent error, though it could be temporary if the bounce happened due to some temporary problem on the receiver's end.
mark_failed/4Mark as failed, happens on connection errors or on errors returned by the receiving smtp server.
mark_read/2Mark an email read, typically because a link in the email is followed.
mark_received/2Increment the email receive counter.
mark_sent/3Track email sending, a sent is marked 'final' if there wasn't a bounce within 4 hours.

Function Details

block/2

block(Email0::binary(), Context::#context{}) -> ok

clear_status/2

clear_status(Email, Context) -> any()

clear_status/3

clear_status(Id, Email0, Context) -> any()

Clear the status of the email address

get/2

get(Email0::binary(), Context::#context{}) -> list() | undefined

Fetch the stats from an email address

install/1

install(Context) -> any()

Install the email tracking table

is_ok_to_send/2

is_ok_to_send(Email::binary(), Context::#context{}) -> boolean()

Check if an email address is known to be valid, if nothing known then assume it is valid.

is_valid/2

is_valid(Email::binary(), Context::#context{}) -> boolean()

Check if an email address is known to be valid, if nothing known then assume it is valid.

m_get/3

m_get(Rest::list(), Msg::zotonic_model:opt_msg(), Context::z:context()) -> zotonic_model:return()

Fetch the value for the key from a model source

mark_bounced/2

mark_bounced(Email0::binary(), Context::#context{}) -> ok

Mark as bounced, this is handled as permanent error, though it could be temporary if the bounce happened due to some temporary problem on the receiver's end.

mark_failed/4

mark_failed(Email0::binary(), IsFinal::boolean(), Status::binary() | {error, term()} | undefined, Context::#context{}) -> ok

Mark as failed, happens on connection errors or on errors returned by the receiving smtp server. The final flag is set if our smtp server received a permanent error or gave up sending the email. Keep a counter (recent_error_ct) and date (recent_error) which are updated at most once a day.

mark_read/2

mark_read(Email0::binary(), Context::#context{}) -> ok

Mark an email read, typically because a link in the email is followed.

mark_received/2

mark_received(Email0::binary(), Context::#context{}) -> ok

Increment the email receive counter. This doesn't say anything about the validity of the email address, only that we received an email with this envelope address.

mark_sent/3

mark_sent(Email0::binary(), X2::boolean(), Context::#context{}) -> ok

Track email sending, a sent is marked 'final' if there wasn't a bounce within 4 hours.


Generated by EDoc