New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How exactly do you use sails to send mails? #6833
Comments
@highskillzz Thanks for posting! We'll take a look as soon as possible. In the mean time, there are a few ways you can help speed things along:
Please remember: never post in a public forum if you believe you've found a genuine security vulnerability. Instead, disclose it responsibly. For help with questions about Sails, click here. |
Anyone? |
You can optionally create a helper and integrate nodemailer // am using gmail transports in this example
module.exports = {
friendlyName: "Send email",
description: "Sails helper to send emails",
inputs: {
to: {
type: "string",
required: true
},
subject: {
type: "string",
required: true
},
text: {
type: "string",
required: true
}
},
exits: {
success: {
description: "All done."
}
},
fn: async function(inputs) {
var nodemailer = require("nodemailer");
var transporter = nodemailer.createTransport({
service: "gmail",
auth: {
user: "example@gmail.com",
pass: "password"
}
});
var data = {
from: "demo <no-reply@demo.com>",
to: inputs.to,
subject: inputs.subject,
text: inputs.text
};
sails.log.debug(data);
transporter.sendMail(data, function(error, info) {
error
? sails.log.error(error)
: sails.log.info("Email sent: " + info.response);
});
}
}; or checkout https://github.com/mikermcneil/ration/blob/master/api/helpers/send-template-email.js |
@highskillzz You appear to have sails-hook-organics installed which includes some basic mailgun stuff. The "Web App" starter project should include some basic email functionality if you add your mailgun config. The Ration app also has a few examples of how to do it (using the sendTemplateEmail helper method to hide away some of the messiness of loading email templates). https://github.com/mikermcneil/ration/blob/master/api/controllers/entrance/signup.js#L106 |
Please answer this question I have, I have used zoho for making company emails and used my domain records over there. But, now I have to validate emails I get from users and mailgun seems to do that(from what I understand), but it is also asking domain details and to put records over there. Is there a way I can verify emails but not change zoho since it is providing company emails for free |
@highskillzz Hi! I think that Mailgun gives you up to 12,000 emails per month free. The Sails web app template also provides send template email, which is designed to be maximally customizable. See: |
I have used the template that comes when sails new is used, I originally thought that changing the config of verifyEmail would do what I need after adding the mailgun creds but this is not happening, this is my package.json
and I also don't see mailgun anywhere. How do I do this exactly?
Thank you
The text was updated successfully, but these errors were encountered: