-
Notifications
You must be signed in to change notification settings - Fork 3
RESEARCH: figure out email solution (2) #22
Comments
Documentation for email solution: Using Mandrill: Mandrill is a lightweight wrapper used for messages/notifications. The Mandrill gem uses an API stored as an environment variable called MANDRILL_APIKEY. A message is sent by creating a new instance of the class and passing the message as a parameter. Mandrill supports the following output formats: A simple implementation: require 'mandrill' Body of email.",:from_email=>"[email protected]" } sending = m.messages.send message A template may be useful to create a more advanced design for the email: require 'mandrill' rendered = m.templates.render 'MyTemplate', [{:name => 'main', :content => 'The main content block'}] More information can be found at https://mandrillapp.com/api/docs/index.ruby.html Using Amazon SNS/SES: Amazon SNS (simple notification service) coordinates and manages the delivery or sending of messages to subscribing endpoints or clients. This implementation option has many customization and configuration options that that may be extremely useful. A client will need to be constructed by defining :region and :credentials: Default credentials are loaded automatically from: • ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY'] Credentials can also be configured using :access_key_id and :secret_access_key. creds = YAML.load(File.read('/path/to/secrets')) Aws::SNS::Client.new( Using sns.publish(), you can set the subject and message as well as other attributes of the email as parameters. This method accepts file references for the message parameter. More information can be found at: http://docs.aws.amazon.com/sdkforruby/api/Aws/SNS.html Using ActionMailer and Gmail: This implementation will use a mailer class to set the user, receiver, and subject. While this implementation is relatively straightforward, using a service like Mandrill will reduce development time and possible maintenance. Below is sample code regarding the basic implantation of ActionMailer.
In order to customize the body of the email, an HTML file must be created.
In order to send emails from gmail, an application and production file will be needed.
Finally, this implementation option need a controller that will trigger the 'send event'.
|
It looks pretty simple especially if we use Mandrill. The final option includes too many files and most likely needs manual update. Amazon SNS seems like it is more secure, but also requires more work. There would need to be some documentation (we can probably take some of the documentation here) within the project if we are to use any of these, so that future coders know how the email system is working. I would give it a 3 for Mandrill, and a 5 for ActionMailer and Amazon SNS. |
--4 hours
The text was updated successfully, but these errors were encountered: