How can I configure Meteor to use Amazon SES when running on Heroku? - heroku

I would like to use the built in email methods that Meteor provides, but I need my app to run on Heroku and use the smtp endpoint of Amazon SES to transport my message.
I'm using the Meteorite build pack and the accounts-password package.

Follow instructions below to get meteor emails sending correctly from heroku using amazon ses
1) set up smtp access via aws console, get your smtp credentials
2) using a javascript console (chrome dev tools / firebug) run
encodeURIComponent("SES_SMTP_USERNAME")
encodeURIComponent("SES_SMTP_PASSWORD")
to encode the username/password for use in your smtp url
3) take resulting strings to build your smtp url like so
smtp://ENCODED_USER:ENCODED_PASS#SES_SMTP_URL:465
4) set the MAIL_URL variable to tell meteor to use this method for sending emails
heroku config:add MAIL_URL=YOUR_SMTP_URL
(do not surrond the url with qoutes)
5) set sender to be a SES verified sender within your meteor app via
Accounts.emailTemplates.from = "SENDER_NAME <SENDER_EMAIL>";
That will allow Meteor default email methods to function properly.

In addition to what you've suggested in your gist you could also use Meteor.http methods with SES API and send a POST/GET request.
Full API docs at http://docs.aws.amazon.com/ses/latest/DeveloperGuide/QueryInterface.Examples.html
Of course this is a manual solution, and wont use the built in meteor mail method. It can however be corrected by redefining the mail function via Email.send = function(...
UPDATE
You can also use the email-ses package on atmosphere
mrt add email-ses
More info here: https://atmospherejs.com/package/email-ses

Related

How to work queue for sending verification mail on cpanel?

Successfully enable mail verification using redis in locally in my laravel project. But when this project upload in cpanel verification mail not send and didn't give any error.
I am using both shared and dedicated hosting.
I used smtp gmail in .env.
how to enable or work queue in cpanel.
On you AppServiceProvider.php
use Artisan;
and past this inside boot method
Artisan::call("queue:listen");

Email verification failing

I have installed Parse Server directly from Heroku and mLab button and then Deploy to Heroku Button.
This is working fine, but now I need to set up email verification. I have installed Mailgun and Mailgun Email Verification addons directly from Heroku. Under Config vars the correct keys are all there, but I get the error
An appName, publicServerURL, and emailAdapter are required for
password reset and email verification functionality. (Code: 1,
Version: 1.17.2)
I was under the impression that when installing addons directly from Heroku, the settings was deployed automatically. Do I need to configure anything else after installing?
That message isn't from Mailgun; it's from the parse server itself.
You'll have to either customize the code or configure it properly. I don't think the example code gives you a way to configure appName, publicServerUrl, or emailAdapter from the environment so you'll probably have to deploy a customized instance that sets those variables. This example looks helpful.

Laravel not sending emails on Platform.sh to SendGrid

Im hosting a Laravel spark website on platform.sh. I have configured the environment variables within the platform.sh GUI to be what is suggested in their guides but for some reason SendGrid isn't picking up the emails.
I am using my SendGrid Log in details for username and password - I have also tried by using my API Keys.
There are no errors or anything and both SendGrid and Platform.sh are being useless saying they can't do or see anything, so im pretty lost as to where I go next. I have tried many various configuration options but none seem to have worked.
Here is the snippet of code to send the mailable in Laravel:
Mail::to($input['email'])->send(new BetaSignUp($referral, $referralFacebookUrl, $referralTwitterUrl));
Has anyone successfully got Laravel running on platform.sh, and sending emails via SMTP (SendGrid)
Thanks
EDIT
With the help of PSH i have run a python script they sent me to do a test on the container - this test was successful and I can see the email in SendGrid. Here is the test Script:
import smtplib
sender = 'info#smbstreams.live'
receivers = ['to-email#email.com']
message = """From: Deck Stream Team<info#smbstreams.live>
Reply-To: Deck Stream Team<deckstream#smbstreams.live>
To: To Person <to-email#email.com>
Subject: SMTP e-mail test
This is a test e-mail message.
"""
server = smtplib.SMTP_SSL('smtp.sendgrid.net', 465)
server.set_debuglevel(1)
server.login("****", "****")
server.sendmail(sender, receivers, message)
Have you follow this https://docs.platform.sh/development/email.html#enablingdisabling-email
Email support can be enabled/disabled per-environment. By default, it
is enabled on the master environment and disabled elsewhere. That can
be toggled in through the web UI or via the command line, like so:
platform environment:info enable_smtp true

Parse Server Custom Domain On Heroku

I have set up a Parse Server on Heroku, with an MLab MongoDB. Everything works fine, & when I visit https://myapp.herokuapp.com I see "Make sure to star the parse-server repo on GitHub!".
I can successfully perform API functions through my Postman Console, for example logging in via the following REST API call: https://myapp.herokuapp.com/parse/login?username=admin&password=password.
I can also perform other REST API POST, GET, etc. as you would expect.
I'm now trying to use my own domain "api.mydomain.net". In the Heroku App > Settings > Custom Domains, I have set domain to "api.mydomain.net" & "myapp.herokuapp.com" as the DNS target.
I've also added a CNAME record to the DNS pointing "api" to "myapp.herokuapp.com".
When I visit https://api.mydomain.net I see the "Make sure to star the parse-server repo on GitHub!" message confirming that the CNAME record works, however when I go to perform the same REST API Login call https://api.mydomain.net/parse/login?username=admin&password=password I get the response:
Could not get any response.
This seems to be like an error connecting to
https://api.mydomain.net/parse/login?username=admin&password=password.
What am I missing?
You are trying to securely connect to the Parse Server with https. So you have to add a TSL certificate for your Heroku app in the Heroku dashboard.
Open Heroku app in Heroku dashboard
Open Settings tab
In section Domains and certificates click Configure SSL and choose Automatically configure using Automated Certificate Management.
Click Add domain to add the domain from which the request should be forwarded, e.g. api.example.com.
On your domain registrar's website set the CNAME for api.example.com to the domain in the Heroku app settings, e.g. api.example.com.herokudns.com
Wait until the status of the domain in the Heroku dashboard is Done

Sending email via Postmark on Heroku with a MeteorJS application

I have recently deployed my MeteorJs application to Heroku and have setup the Postmark addon to be able to send emails.
I setup the MAIL_URL config item and the authentication works, but when an email is sent Postmark returns this error:
ErrorCode: '400', Message: 'Sender signature not defined for From address.'.
The From address that Meteor sets by default is no-reply#meteor.com. I tried setting up a signature in my Postmark addon using my personal email, but you can't do that either.
Anyone have luck getting this setup?
You need to define a sender signature:
To get started, run heroku addons:open postmark and create your first sender signature.

Resources