https://github.com/hachreak/pushmail
An OTP generic framework to handle different plugin to send email.
https://github.com/hachreak/pushmail
email email-sender erlang-libraries erlang-library
Last synced: 5 months ago
JSON representation
An OTP generic framework to handle different plugin to send email.
- Host: GitHub
- URL: https://github.com/hachreak/pushmail
- Owner: hachreak
- License: gpl-2.0
- Created: 2015-11-30T20:36:45.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-19T21:44:24.000Z (about 9 years ago)
- Last Synced: 2025-02-16T22:27:53.806Z (8 months ago)
- Topics: email, email-sender, erlang-libraries, erlang-library
- Language: Erlang
- Size: 1.41 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
pushmail
========[](https://travis-ci.org/hachreak/pushmail)
An OTP generic framework to handle different plugin to send email.
Configuration
-------------To configure for example the plugin to log the email sent.
```erlang
[
{pushmail, [
{backend, pushmail_backend_error_logger}
]}
]
```Usage
-----Start `pushmail` with arguments or without (e.g. you don't need nothing
special to start the `error_logger` plugin):```erlang
{ok, AppCtx} = pushmail:start(...).
```or
```erlang
application:ensure_all_started(pushmail).
{ok, AppCtx} = pushmail:start().
```After that, you are ready to send email with:
```erlang
Mail = #{
sender => <<"test@mydomain.org">>,
receivers => [<<"receiver@otherdomain.org">>],
subject => <<"My subject">>,
message => <<"My message!">>,
headers => {}
},
{ok, NewAppCtx} = pushmail:send(Mail, AppCtx).
```To stop the application:
```erlang
pushmail:stop(NewAppCtx).
```Plugins
-------**error_log**
The plugin simply log in console the email sent (without do nothing more).
To load the plugin you need to configure `pushmail` and start it with:
```erlang
[
{pushmail, [
{backend, pushmail_backend_error_logger}
]}
]
```Build
-----$ ./utils/rebar3 compile
Tests
-----$ ./utils/rebar3 eunit