how to send "order is confirmed emails to customer" in django - reactjs

I am trying to make an e-commerce website in Django and react. but I am not able to find a way for this scenario.
whenever a user purchases something a confirmation email should go to the user and one to the admin that a user buy something.
can we do this just by code or we have to use something like Mailchimp?i want to do it by writing code.

You don't need a service like Mailchimp for this. You need to write your own code for sending emails.
To send emails in Django you need to configure a mail server. You can use your own mail server or use providers like AWS SES (Simple Email Service) or SendGrid.
Then you need to write the code that will send two emails after the purchase. Ideally, it should be done in the webhook that will wait for payment confirmation from your payment provider (for example Stripe).
BTW, I'm working on Django+React tutorials at SaaSitive and just committed example code how to send activation emails (after registration) https://github.com/saasitive/django-react-boilerplate

Related

React Form send email

I am building a form in react and I wanted to send it to my email when the user clicked the submit button.
I was looking at Microsoft Graph API for sending the email (https://learn.microsoft.com/en-us/graph/api/user-sendmail?view=graph-rest-1.0&tabs=javascript), but checking it, seems that it needs a temporary token, so I can't use it as I would need to be changing the token every hour or so.
So, I'm basicaly trying to find an API like the Gmail but for office 365 accounts (https://developers.google.com/gmail/api/guides/sending), as we can create a gcp project and use the keys that it generates for us, instead of using a token like the MS Graph API
Generaly I would use a route in my API, but this site is static, so I do not have any API (neither serverlets, cloud functions or other stuff like it).
Is there any away to send an email through a Microsoft API from my web client in react, using only a token specific to the domain? Or is there a better away to acomplish this same result?
I highly recommend using https://formsubmit.co/. It's free and I personally use it in many projects. Works flawlessly with many features like email templating, captcha, reply_to, etc.
No backend knowledge is required. Can set it up in like 1 minute.
One option would be to authenticate on behalf of the user.
You can also have a small proxy API, dedicated for the purpose of allowing the users to send an email.

Sending Alertmanager alerts to my email address with Jenkins mailer webhook

I have my Alertmanager up and running and I can see all active alerts on alertmanager dashboard.
Now I want an email notification for alerts based on created rules.
I tried getting internal smtp details but seems like its a very hectic task in organizational env.
For other small tasks, we use Jenkins webhook to send an email notification to our org email address and it works.
I assume there is something I can do to integrate alertmanager with Jenkins and send alerts to my email address, but not completely sure how to do that.
I was wondering If someone can redirect me to a relevant post or a brief HowTo to achieve this model.
thanks in advance.

Check email id real or fake in AngularJS project

I have a web project in AngularJS and using NOdeJS and ExpressJS on Backend.
I have a contact form in my application when I click on submit form data is sent as an email. This I have achieved using npm package called nodemailer.
But, now I wanted to check if that email id exists in real world (fake or real) before sending an email. So what is the best way to achieve this?
Can any one help me with this?
Thank you
There are some open source api like http://api.mailtest.in/v1/XXX
Where XXX is the domain from email. Which means if XXX exists as domain you can assume that mailbox might exist. Try using curl / parser to fetch the response via api call if its true means domain exists and email might exist as well.
Theoratically its possible by actually sending email and verifying the response itself. Check this https://github.com/hbattat/verifyEmail
But still there are certain conditions, many times the responses are not being sent by Mail Exchange servers for security reasons. Also your email can be blacklisted by doing this.
The real world scenario might be simple with user interaction, send email and ask them to verify their mail using the secret shared in email.

Open Gmail Client With File Already Attached

I see you can send emails with uploaded attachments using the Google Gmail API. However, I want the user to be able to preview the email before sending. It looks like there isn't a way to do this?
So essentially would the only solution be to create my own simple email client, then send the email through the API? Or would using the API even be necessary as in that case I could just use the server's native sendmail client to sent out the email with the user's gmail address as the return address.
I guess using the API, the advantage is the email would appear in the user's SENT folder.
Unfortunately, I don't think there's a live preview that's available in a way you intended. As far as I know, Outlook (for reference) doesn't even have it. What they have is to upload the attachments while the mail is still being drafted.
The best I can think of is once the message will be sent, save it as draft at first and retrieve the mail again on the succeeding page. This will look like a preview that you intended. Once done, you can then finally send the drafted email to the receipients.

Paypal Integration in Web application

The scenario is that users of web application can purchase digital items. The web application will use Paypal Instant Payment Notification.
The IPN protocol consists of three steps:
PayPal sends your IPN listener a message that notifies you of the event
Your listener sends the complete unaltered message back to PayPal; the message must contain the same fields in the same order and be encoded in the same way as the original message
PayPal sends a single word back, which is either VERIFIED if the message originated with PayPal or INVALID if there is any discrepancy with what was originally sent.
Let's say it's VERIFIED, how could I know who have completed the transaction or purchased the item (user of the web application) if the user used other email address in his/her paypal? I have stored the email address of the user in session but what if he/she have different paypal email? Paypal email is included in IPN message.
For other details, maybe not useful, the application is written in Struts2 in Google-App-Engine.
You'll need a way to correlate the IPN data coming back with the user. Either by asking them to provide their paypal email or using the username/password generation facility in the IPN service. Here is a somewhat inelegant but functional approach:
When the IPN comes in off the wire, persist the paypal generated username/password and payer_id (in perhaps the datastore).
If you can't correlate by email, then when the user comes back to your site request that they enter the username/password generated from paypal's site once (just to correlate).
Lookup the username/password and then correlate their userid from the UserService back to the payerid.
The reason to use IPN is for subscription services as you can get IPN messages when the subscription is terminated, cancelled, or when payments come in (for an account that stopped paying).
The most important thing to think about is how to correlate a user of your site back to the payer_id (or even payer_ids in some cases) that are used to pay for the services they are using.
On another note, I wouldn't use the session to store information for IPN callbacks, those actually can take a LONG time sometimes (say when the x.com conference is on and everyone is hammering paypal).
If you have a running application or a better description of the look & feel, I might be able to come up with a more elegant suggestion. Let me know if this helps at all.
Why don't you use PayPal's express checkout? This way you negotiate server2server a token and then you can check with PayPal the result of that token on user's return.
If users are buying directly from your application it's easier to implement.
And I think it'is more robust than the method you're using (I never heard of it before :D )

Resources