Django email contact me form - django

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

Related

Django Unit Testing That Needs OAuth Authentication

I have a Django project that uses Gmail API to send bulk emails. Users can create campaign emails and send them to multiple contacts. If a contact answer to any of the emails in a campaign then that contact should no longer receive emails from that campaign email.
I want to add unit tests for this feature and I don't know what approach to use because I need to authorize one Gmail account first and only after that use that account to send the campaign email. Also I would like to test the replies of that campaign, which means that I need to authorize a new Gmail account that will be used to send the reply.
So this is what I plan to do:
1. Authorize two Gmail accounts manually.
2. Inside the tests I will search for the first two Gmail accounts from the database and use one of them to send the campaign email and another one to reply to an email.
The only problem is that I am not sure that this approach is the best, this is why I am asking here, maybe someone has a better idea.
Thank you!
You also can write accounts authorization code in unittest.TestCase.setUp(self) method. It will be called right before each of your test methods. Considering OAuth usage, I strongly recommend to you to use Requests package. It's quite handy in any API testing and stuff.

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)

Django 1.8: Is there a User-to-User messaging app that works both via the website and email?

I'm looking for a way for users to message each other via the website, with their own inbox, sent, etc folders, and to receive and reply to these messages via email as well. The email addresses used for replying are generated by the app to hide user's real emails. The app sits in the middle of the two users via the site and via email.
Both django-messages and django-postman give very little information about what email-related features they have. Can either do this, or is there an alternative?
Thanks
django-messages includes pretty much all you asked for including inbox, outbox, trash and many more goodies
django-postman seems even better and is in active development
try out these packages they both include documentation.

ColdFusion - How to read user name instead of login name

I have inherited a ColdFusion application (and I'm a noob in ColdFusion) which uses GetAuthUser() to read the name of the logged in user, and then appends #mycompany.com to send emails.
We are going to be migrated to a new domain, under which we are receiving user names that do not match our email addresses.
For example, I login as rickhodder and my email address is rickhodder#mycompany.com, and my login under the new domain is C12345, but my email address will still be rickhodder#mycompany.com.
From some research online I see that ColdFusion doesnt go against active directory, it goes against the NT Domain.
Is there a way under ColdFusion to read the email associated with a user?
I don't think CF is going to provide you with that information 'out of the box'. You probably want to look at the CFLDAP functionality and use that to look up user information from your AD server, which ought to include the information you need.
If you go this route, you can use your own details to connect for development, but make sure you get an account created to do the LDAP connections with in production. It should have password set not to expire and not have permission to login or do much else. It's likely your domain admin will know what you're after far better than I can explain.