How can I get sendgrid entries from send email? - ruby-on-rails

I use one sendgrid account in multiple projects, and use a same send email per project. Now I want to fetch the "Bounces" and "Invalid Emails" entries for specify project, can I get them with the same send mail?

SendGrid does not store the from address for consumption with these API's so what you are looking to do unfortunately isn't possible this way.
Two options I recommend looking into as an alternative are:
1) Use subusers. This will allow you to have separate accounts under the same parent account. You'd have to change your credentials and query for the bounces and invalid emails separately.
2) Use categories and the event webhook. SendGrid will send you a post request containing the event type and the category you added to the email.

there is also unique arugments option to send with emails. use this option as a name or id of the project. then later fetch status of these emails via this unique arguments.
I recently done this work, let me know if you need any help.

Related

MSGraph - Getting external email conversation from reply

My team is building a ticketing system. The goal is when we receive a new email we create a new ticket. All responses to that email are saved on the same ticket.
We have these basic goals working in simple cases, however, there is one case that we are struggling to find a good solution for. A client will email us, which creates a ticket, and we reply back requiring information. The client will send our reply to someone internal to their company. Then they will send the response back to us by replying with "see below". This response will have the conversation between them and their co-worker in the comment section of the email. The comment section will also contain our entire email chain which we don't want to duplicate.
The issue we are having is grabbing the conversation they had from the comment section to include with their response of "see below" and add them to the ticket. The only method we have come up with to solve this is manually parsing the comment section of the email, however, this is error-prone.
Does anyone know of a better way of tracking conversations they send you through the email?
We are using msgraph internally to send and receive emails and using their apis they have uniqueBody and body, but they don't seem to have a way to break the body up into its different parts.
What I need any of these options
1- get list of unique bodies from the email chain without using conversation Id as it will not be sufficient in some cases.
2- get the previous conversation Id of the incoming email. I mean if that email is a list of emails and it forwards to me.
UUID uuid = UUID.randomUUID();
message.addProperty("InternetMessageId", String.format("%s",uuid.toString()));
send InternetMessageId with a unique identifier to grab conversation id
change order only

How do I add In-Reply-To and References to 'Send mail'?

My feature was built before /createReply existed and relies on:
Set a custom header with Outlook/Office 365 REST
to add References and In-Reply-To to an email. This allows the app to send email replies w/o requiring Mail.ReadWrite, which is much more access than we need:
https://learn.microsoft.com/en-us/graph/permissions-reference#mail-permissions
Read and write access to user mail
Allows the app to create, read, update, and delete email in user mailboxes. Does not include permission to send mail.
Now those headers no longer get added. (I also tried Cannot pass "In-Reply-To" parameter to Microsoft Graph sendMail and arrived at the same result as the author.)
Is there a way for me to get around this regression without requesting additional user permission? Thanks!
https://learn.microsoft.com/en-us/graph/api/user-sendmail?view=graph-rest-1.0&tabs=http
As of 2019-10-04, Microsoft published changes to their /reply endpoint which now allows for message:
https://learn.microsoft.com/en-us/graph/api/message-reply?view=graph-rest-1.0&tabs=http#request-body
https://github.com/microsoftgraph/microsoft-graph-docs/pull/5771
With the message field, I should be able to send replies w/o requesting additional permissions.

How to disable sending default emails when a user place an order?

I am working on a Third party application where I want to send customized template emails to user using webhooks when user place order or shipment gets created.
Is it possible to prohibit system to send email to user who place order and instead of that just fire an event to a third party app(using a webhook) so that that third party app will send email to that user with required and customized new details in new email template(which is not available in default variables of email templates)?
Any solution for this? Please
There's two options. One enables you to prevent emails from being sent and the other repurposes the initial default email. There isn't currently a way to disable the email from being sent as the setting doesn't existing in BigCommerce.
Option 1
Set up an SMTP server and configure mail relay rules
SendGrid covers some good basics on what mail relay is. BigCommerce has a support article for connecting your store to a custom SMTP server. You can also see more in the instructions from Microsoft on how to configure mail relay rules for Exchange.
Overall, this option is more complex.
Option 2
Conversio has a quick and easy guide on replacing the content of the default emails. It isn't the ideal solution, but it is less confusing than sending two receipts.

Check hard bounce email in rails using mandrill

Is there any way to find whether the email is legitimate or not. I am using mandrill and some emails were hard bounced so, is there a way where mandrill can send a response to my rails application that email was hard bounced. Or is there any other way to find that email actually exists or not through other medium. I saw a gem https://github.com/kamilc/email_verifier but there were some issues so I am not sure to use it or not.
Thanks in advance for help
I think you are looking for Mandrill's webhooks
The idea is that you set up an endpoint to receive event notifications (including bounces) from Mandrill.
One best solution is to implement webhooks which returns all status of emails sent. The webhook can be customised to recieve what response you can recieve including sent and delivery also. It also helps in tracking open and click rates which could be later used for filtering privileged users.
https://mandrillapp.com/api/docs/webhooks.html

How do I get email analytics in sendgrid?

I am sending email using sendgrid.
Are there any options in sendgrid to get email analytics (open/bounced/replied emails) for each users email address?
I've done this two ways before:
1) Use SendGrid's Event API to collect and aggregate the data yourself.
2) Use a service like sendwithus on top of your SendGrid account, which will collect your SendGrid analytics for you and provide analytics by recipient, template, segment, etc. They also provide an API and Ruby client.
Once you're logged into SendGrid, navigate to the Stats Dashboard.
You should then be able to see something like this:
I hope this helps.
Yes, There are option available for this, to get the status of individual emails sent via sendgrid.
Send a unique arguments with every email you sent and then later on you can get status of these emails with reference to unique argument.
Some more explanation of your question will help us a-lot to describe you the best possible solution.
i have recently done this work, so if you explain the whole scenario, i will come up with the solution.
There are two ways to get hold of this data:
Use the SendGrid Event Webhook to get near realtime information about every event for every email you send via SendGrid. It works by issuing a POST request to a URL that you specify.
You can then store all this data for consumption later on and it's by far the most granular information you can get. Key/Value stores like Redis are a good option for this, but if you want a simple option to get going, check out the SendGrid EventKit to get up and running quickly.
Or:
Grab the data via the Stats API. This endpoint allows you to grab the numbers you need in a multitude of ways for both main and subuser accounts.
Based on your question, you should investigate the Event Webhook as it will give you most clarity on what happens with each email you send.
You can now use Thinbox to get analytics from Sendgrid, Mailgun, Mandrill, or just by bcc'ing an email address they give you. It's basically like EventKit but for the rest of the ESPs too.

Resources