Send Notification after sending HTTP Response - email

I am new to programming.I am using golang in the backend and reactjs in the front end of the leave Web application that i m creating.
When an employee apply leave i must send email to the in-charge of the employee and employee who applied the leave.Since the email send is taking long time i want to run the email function in go routine.If that the case the http response is send before the status of the email function is returned(Example: Email Send Success or Email Send Failure).
So i would like to push the result of the email function in notification to the front end from the server.But i don't know how to do it as the server already given the http response to the front end before the completion of the email function.
Is there any other better idea to implement this please let me know.Appreciate any help.Thanks

Related

Can I stop a SendGrid mail if it received a certain parameter?

I'm using a certain SendGrid template for several different projects and am trying to find a way to stop emails from going out in some conditions, through SendGrid.
For example, lets say I'm passing SendGrid some parameters like:
{id, name, amount, date}
I want to stop that email from going out when i'm passing a certain id.
I know that I can change the email template i'm sending with conditionals using handlebars:
From here
But Can I actually stop the mail if some condition happens?
In my case, every time I send the id = 5
You can control the body of the email using Handlebar templating, but by that point, you have already told SendGrid to send email with the data you provided. You cannot stop the email from being sent from within Handlebars.
If you're using code to tell SendGrid to send these emails, you could check in your code if the id equals 5, and if so, do not send an email.
If you're using Single Sends to send an email to SendGrid Contacts, you could to store this id field as a custom field, and create a segment or update your existing segment to filter out the contact with that id.

SendGrid send mail - how to keep track of emails?

I am sending emails from sendgrid from my backend. When I send the email, the response is 202 and the response body is empty. Since the response body is empty, i do not have any information like an ID to track the email events in my system.
When I go to fetch the events, i see they have an ID, but since I don't have that ID from their creation, I cant map emails I sent to events I received.
Can you give an email an ID or label it somehow when you send it? So that you can map al the events from it?
What we are trying to do is to have a list of "transactions" where each "Transaction" is affiliated with an email. We want to provide email event data in our app, but can't figure out how to map
The response body of a successful Mail Send API call is empty, but the response contains a x-message-id header which you can use to retrieve details about the messages being sent.
Since one API call to the Mail Send API can result in multiple emails being sent, this ID identifies the group of messages, and they'll all be prefixed with the x-message-id. For example, if x-message-id returns W86EgYT6SQKk0lRflfLRsA, the IDs of your messages will start with that and then be suffixed with something like .filterdrecv-5645d9c87f-78xgx-1-62841247-82.1.
Together it'd look like W86EgYT6SQKk0lRflfLRsA.filterdrecv-5645d9c87f-78xgx-1-62841247-82.1.
If you want to track the messages, you can use the event webhook or pull the information via the Email Activity Feed API.
This Stack Overflow Q&A about tracking bulk email statuses may also be useful to look at.

Marketo send test failed

Try to send a sample of an email and receive a notice that the Marketo send test failed.
There are two token-related reasons that Send Sample may fail:
You may have an invalid value for a token in your email. If there is an incorrect token value, the send sample will not work.
Example: If you have the token for first name written like this {{lead.FirstName:default=Hello}}, when you try to approve the email Marketo will let you know that the token value is incorrect. The correct token value is {{lead.First Name:default=Hello}}. For this example if you change the token value to {{lead.First Name:default=Hello}}, Marketo will allow you to approve the email and it will allow you to do a send sample.
You may have a token in the From or Reply-To line that is not populating with an email address
Example: If you have a token in the Reply-To like this one, {{lead.Email Address:default=edit me}}, then the Send Sample using the default will have "edit me" in the Reply-To, which is not an email address. Marketo cannot send an email without a Reply-To email address, so the Send Sample will fail.
If any of the above does not apply, run the following tests and provide the information to Marketo Support
Clone the email in question and test to send as a sample
Create a new email and test to send as a sample
Send the email via a live campaign or a single flow step to a test lead

Request callback URL from webmail when new mail received

I am using my domain mail "example#demo.com". I am receiving query mails over it. Now I have to insert some data in my DB when new mail will be received on this "example#demo.com" webmail address. My question is that is there any webmail webhook or another way to call the decided URL. The purpose of this I have to send confirmation message to user.

Get Response From External App in Windows Workflow

i am working on one small app i.e workflow wcf service which takes input of array of email and parallelforeach is sending email to each email id. in email i am sending two links for approval and decline which should call my MVC web application controller.controller calls my methods in workflow service for remaining execution.there is a console application which initiate a request of sending mail. mail sent successfully but when i click on the link given in the mail for approval or decline it does not work ! please suggest me something..