I want to send email attachment using nodemailer in node js.i am using elasticemail gate way - node.js

I need to send a URL attachment in nodemailer.i try to many ways but mail was not deliverd.I was seen elasticemail gateway they showed a error like this "suppressed" how will i solve this issue
attachments:[{ // use URL as an attachment
filename:'GSTR3B_33ADQFS8223E1ZY_012019_1551501263.pdf',
path:'my url'}]

if you are getting "suppressed" from Elastic Email check in the Contacts section on your dashboard to be sure that the contact is in an "Active" state. The contact might be suppressed by the system.

Related

How to use Twilio to send customized PDF’s from Google Drive/Sheets

I am having problems trying to send customized PDFs from Google Drive to users on WhatsApp using Twilio’s API.
I am using node.js and the documents are created in Google Sheets and stored in Google Drive.
client.messages
.create({
mediaUrl:['https://drive.google.com/uc?id=INSERT_FILE_ID&export=download'],
from: 'whatsapp:+14155238886',
body: `It's taco time!`,
to: 'whatsapp:+15017122661'
})
.then(message => console.log(message.sid));
I thought it would be possible to send the PDF by passing the PDF’s Drive link through MediaURL as that is what is recommended on Twilio’s site for sending media (Images, .mp3’s and PDF’s) but when I try that it doesn’t work.
NB: it works when I try image URL’s etc.
I have tried sending the webContentLink of the PDF that also doesn’t work.
example: how the pdf should look when sent
I do not want to send the user a normal link for them to leave WhatsApp.
Any help with this or any other method to achieve this would be greatly appreciated.
Twilio will check the content-type of the file which you have been passing in the mediaUrl parameter. Twilio will reject if the content-type headers of your media attachment do not match the file extension (for example, content-type is image/jpg but the file extension is .png). It specified in the following links specifies:
Twilio Troubleshooting
Twilio supported-mime-types

Netsuite REST API for email communications

I am trying to find where in the NetSuite REST API the communication messages are stored. I have looked at messages but the list returns 0 even though there are a lot of emails that have been sent. Guessing I'm looking in the wrong place but not sure what path the records are in.
Also once I get the emails, is there a way to extract the attachments sent in the emails to download using the API?
Thanks!
You can execute a SuiteQL query.
POST https://[account].suitetalk.api.netsuite.com/services/rest/query/v1/suiteql
Header: Prefer: transient
Body:
{
"q": "SELECT id, authoremail, subject, datetime FROM message"
}
However, adding the attachments field to the search results to an unexpected error.
The record and field IDS are in the Analytics browser: https://[account].app.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2020_1/analytics/record/message.html.

Is there a way to send the verification email with the Firebase Admin SDK from my Node.js server?

Is there a way to send the email verification email from my server ?
This is how it's done on the client:
authData.sendEmailVerification().then(function() {
Is there a way to do it on the server ?
firebaser here
To my surprise there currently is no option to send verification email from within the Admin SDK. I'd recommend you file a feature request.
What you can do from the Admin SDK is update a user profile to mark their email as verified. This allows you to take control of the entire verification flow if you want to, finishing with a call to admin.auth().updateUser(...) (on Node.js, see the link for other supported languages).
I just came across the same problem as you. There is a function to generate the verification link using user's email address.
I used this function on an array of email addresses, then load the result to my mail automation API to send mails out. This function is weirdly not documented:
admin.auth().generateEmailVerificationLink([EMAIL_ADDRESS])
You can use :
axios.post('https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode?key=[API_KEY]',
{ requestType: 'VERIFY_EMAIL', idToken: response.data.idToken }
)
https://firebase.google.com/docs/reference/rest/auth#section-send-email-verification

Node.js: AWS SES sendRawEmail: mails not getting sent to BCC addresses

I am sending a mail with attachments using mailcomposer and the sendRawEmail method of the AWS SDK. I am able to send the emails using the to and cc fields but when I add an address in bcc, the mail does not get delivered. There is no failure though. Is there any extra configuration not mentioned in the docs that I might be missing ?
I found the answer in one of the issues of mailcomposer. You need to add one extra config in the mail options.
var mail = mailcomposer(options);
mail.keepBcc = true;

How to get body of mail by message-ID or any header

I'm creating an email app. To save time, I just download subject and some header and saved them to database, not download body of mail.
And then, If user click on subject, I will download body of this mail.
I try to use Message-ID (because it's unique) to make it is an index. and Using this code to find this mail on server
SearchTerm term = new MessageIDTerm(ID);
message_s = folder.search(term);
But it just success on GMAIL, some other server, this code doesn't work correct.
I try to get All message-ID and compare it on client side, It toke a lot of time to find, user can't wait too long to get body of email.
Anyone has an idea to find and download body of email correctly by Message-ID or by any header ?

Resources