Use this module to connect your Erlang applications to the AlphaMail service. Start sending transactional email today without the hassle of SMTP and large blocks of unmaintainable HTML.
AlphaMail supports templating (Comlang), DKIM signatures and reliable delivery. Beside that, we got awesome statistics.
To use this service you need an account. You can sign up for a free account on our website.
This is not a service for sending SPAM, newsletters or bulk emails of any kind. This is for transactional emails exclusive. Read more about transactional emails here.
$ ./rebar compile
$ erl -pa ebin/ /path/to/mochiweb/ebin/
Service = alphamail:email_service("YOUR-ACCOUNT-API-TOKEN-HERE").
Payload = alphamail:message_payload(
2, % Project id
alphamail:email_contact(<<"Sender Name">>, <<"[email protected]">>), % Sender
alphamail:email_contact(<<"Joe E. Receiver">>, <<"[email protected]">>, 1234), % Receiver, the 3rd argument is the optional receiver id and should be either a string or an integer
% JSON serializable payload data
[
{"userId", 1234},
{"name", {struct, [
{"first", "Joe"},
{"last", "E. Receiver"},
]}},
{"dateOfBirth", 1989}
]
).
alphamail:queue(Service, Payload).
This module requires these other modules and libraries:
- mochijson