HTML rich email invitation with RSVP button to database? - list

What I am trying to do is this:
Send an invitation for an event via HTML eblast. I would like the users to be able to RSVP straight from the email (click Yes, No, Maybe) and by doing so, will send that info into a database for my client to view the responses.
They specifically do not want responses coming in as emails, they want to view it as a list, and does not want to use something like evite. I've looked everywhere but don't see how to do this. Any thoughts? Thanks in advance!

I believe you would need to dynamically generate an email message for each recipient.
You would alter the Yes/No/Maybe URLs for each recipient so it sends their information to a web page (php/aspx/whatever) that then adds their selection to your database.
So you would loop through your list of recipients, generate the email with a variable altering the url of your Yes/No/Maybe links to something like http://yoursite.com/rsvp.php?user=<TheUsersName>&selection=<YesNoOrMaybe>.
Then just have that rsvp.php page set up to pull the GET variables you passed with the link and add them to your database.

Related

Django email contact me form

So I'm working on this django web app and I want to create a contact me form for my client. My client wants the users of his website to be able to send him emails directly from the form available on the platform. But my client uses a free yahoo email address.
I'm kind of confused of where to begin. But here is my suggested approach see if you can give me an advice:
1- create a form in the forms.py with the different fields of the form.
2 - link the form to the template.
3- create the view for the contact form.
4- add the path in the url pattern.
I read an article that says I need to go through an email service like SendGrid to actually send an email. But it said that I need a professional account to be able to do it.
I really appreciate your attention.
Your way to go looks good.
You do not need any sending service, as long as you have a proper SMTP account to use for sending.
Just add the SMTP credentials to your settings.py and you can use the django core functions to send email messages.
https://docs.djangoproject.com/en/4.0/topics/email/#send-mail
https://docs.djangoproject.com/en/4.0/topics/email/#smtp-backend

How to create an unsubscribe feature in Django?

I am working on a django project, and I'm needing to add an unsubscribe feature to my emails that the server will be sending out. The way that I am managing the mailing list is through a .csv file, which when someone signs up for a service of our's, they get added to the mailing list. In the emails, I want to add an easy unsubscribe feature which would only require the user to click the link in the email, which would lead them to a page that will have a button for the user to unsubscribe from the service, which would be accomplished by removing their name from the mailing list .csv file. My question is, how do I set it up where, when the link is clicked in the email, the website will already know which user is attempting to unsubscribe?
I was attempting to follow a tutorial here Tutorial but I do not have a "user profiles" set up, as it mentions. What other ways might this be accomplished? Is there a way to send the email's username to the website when the page is visited in order for me to make the unsubscription process easier?
Thank you in advance!

Creating a 'View in Browser' link in Mailgun

I've managed to create an email template and sending out email via the Mailgun API along with using the standard variables like the recipient details and the unsubscribe links.
But one thing we would like to offer to the user is the ability to view the email in their browser instead of in the email client. Does anyone know if this is possible out of the box? I've checked all the documentation and I cant see any way of achieving this.
Thanks in advance.

Calling Zapier trigger from Django Code

Is there any way I can call the "Zapier trigger" from my Django Code,
Basically, I am having a Django form where the user will enter several email-id and when the user clicks on send button then I want to send this form data to Zapier in order to do the next action like writing in google spreadsheet or sending email to everyone.
David here, from the Zapier Platform team. The easiest way to do this is to have the form submit against your server and use a library like requests to POST to Zapier. This way, you don't have to worry about CORS or revealing the hook url to your users.
Hope that makes sense. ​Let me know if you've got any other questions!
I am not sure from your question if this is related to how to make the call from Python (which #xavdid answered) or how to trigger a zap. If this is about triggering a Zap, here's the answer.
Setup a Zap by choosing the Webhooks by Zapier app as the trigger. Choose catch a raw hook, if you need more control. In the next step, you will receive a URL where you can POST your form-data.
Everytime you POST data the Zap will be triggered. You can use the data available from your request in the action step for Google Sheets or Emails.
Here are a few Zap Templates that you could start from.
Add info to Google Sheets from a Webhook POST
Send emails from a Webhook POST (Using Zapier's email app)
Send emails from a Webhook POST (using Gmail)

Process a query without changing the page

We have a page which is dynamically generated after a few queries in the database. There are some links that when they are clicked by the user, update some information on the database but they change nothing on the webpage (or the display a discrete message).
How could we stay on the same page without re-rendering it?
Ideally, the corresponding view.py would process the queries and update the database but not the webpage.
You can send and receive your own XMLHttpRequest, but it is too much of works to do and IE will create a lot of problems.
Have you ever heard about jQuery? I strongly recommend you take a look at it and learn how to send and receive Ajax request using it.
You need to make an AJAX call back to the server with the user's actions, and process it on the server. You probably want a different view to process the AJAX request -- you could do it with the same view, but it would be somewhat silly to. The response from that view contains data (probably as JSON) or HTML, which you display on the page with javascript. Check out jquery -- it's great for the client side.
You could accomplish this with plain Javascript and AJAX. When the user clicks on a link, use XMLHttpRequest to call view.py to process the queries.
eg. For the link: <a href="#" onclick=submitdb(); >Click me!</a>
For a tutorial on implementing AJAX (XMLHttpRequest) with Javascript, have a look here:
http://www.quirksmode.org/js/xmlhttp.html