Application for Sending HTML Emails in MIME format - templates

I am coding HTML emails for our company press releases and wondering what is the best way to send a multipart HTML email? Some people say outsource it to a mailchimp.com or a campaign monitor. Other's seem to use PHP on their web server.
What is the best way to send HTML email templates?
Thanks

Depends on how much back end work you want to do. ESP's like Campaign Monitor and Mailchimp are the best option for less technically savvy people. They are also pretty much plug and play. Using other services such as transactional options like Sendgrid, Mandrill or Mailjet, are more API driven. They are designed to be triggered by a program, usually in response to a user action. PHPList is an open source program you can host yourself, so that is also an option.
I would avoid reinventing the wheel, there are a lot of bad things that can happen if you are not really careful. You need to know about CAN-SPAM, unsubscribe handling and deliverability for example. If you get any of that wrong you can trash your domain or IP's reputation and end up getting blacklisted.
For your simple press release example, the easiest option would be to stick with an ESP.

Related

Send a post request to server

I am fairly new in web development and I decided to handle a user's availability to send a POST request to server. However, I do not know even whether it is possible or not but when a user close my Django site without using logout button (For example close the browser or tab), in order to understand the user is offline or online, I want to send a request to server. As a result, when the server does not get an answer from the user for a while, it automatically logout the user.
Can you tell me is it a good way to handle a user's availability and first of all is it a realistic solution? If it is, can you suggest me a document or example that helps me please.
I agree to to the answer of #Mounir. That's not related to django, if you want to know when a user is "disconnected"(close the tab or window) you need to use javascript, in concrete you need to use Sockets.
I recommend you this ones:
http://socket.io/
https://github.com/centrifugal/centrifugo
I'm using centrifugo for one project right now. In concrete, for chat and inbox messaging. It's very simple to make it run with Django.
Greetings
For logging out user you can use the Session expiration, but for all other staff you want to achieve I don't see any thin really related to Django itself, everything depend on your requirements and is more Browser/javascript related than Django.

Track emails to clients within web application

I am developing a Django-based system. It is kind of client-tracking tool.
Some users can work with different client accounts.
I would like to track the emails among users and clients within the application.
The company uses MS Outlook Server as a mail server and users are sending emails from their workstations.
The goal is to have the list of emails to/from users/client on the web page.
I see some possible ways how to do this.
Make the email form on the web page and send all emails from this page. Thus we can store the email sent.
While sending the email - manually add a CC field with the address of robot who will have access to this mail thread and can fetch messages from the inbox sorting them by the sender/recipients.
Automatically fetch messages from user mailboxes (don't want to store their passwords though)
Probably use some mail filter on the mail server to forward messages from/to specified address (don't know how to do this)
But maybe someone can give some advices? Any ideas, guys?
I had done something similar a couple years ago (with Postfix, however, not with MS Exchange).
The best approach IMO is to setup a mailserver to blind-copy each email to your script. In Postfix this called a "custom transport". This way your clients will be able to send emails using any program, not necessary through a web form. AFAIK, nearly all production email archiving solutions work that way.
Sounds like you are looking for something like the journaling feature in microsoft exchange-server. It allows you to define a special mailbox that will recieve a copy of all mails. You can find more information about this here, here and here
Once all the messages are in one mailbox you can access it from your application.

HTML - Storing Data (Cookies)

So I've recently made this Website and they wanted a message at the top of the Website to let everyone know they were still updating the Website and should expect changes to the site. Although I made this message whenever anyone closes the message and then refreshes the page the message pops back up and I don't want this to happen.
How do I go about storing their IP Address so when they close the message it never re-appears.
I couldn't find the answer anywhere but if it has already been asked if you could point me in the direction of the answer that would be great. Thanks :)
As far as I know, there isn't a way to do that with just HTML.
The way I would tackle it is to use simple JavaScript to store/check for a cookie and display/hide a message respectively.
the cookie is part of the document object in JavaScript, if you're not familiar with JavaScript, or just looking for some explanations then feel free to Google "JavaScript Cookies" or check this link for a simple tutorial from w3schools.
Also, just to explain why I would choose cookies over storing IP addresses, this approach (cookies) does the job on the front-end, which transfers the overhead into the client's machine. While storing IP addresses (or tackling the problem in a similar manner) requires a server-side solution, which means slighlty more things for your server to do, and a lot more for you to do (You'll need to code that in PHP or so in order to implement it on the back-end).
I hope my answer get you on the right track.
Good luck with your project.
P.S some countries' regulations require you to display a disclaimer of some sort just to let the customer know that "Our website uses Cookies to store information on your device", make sure you cover that base in case you go for Cookies.

Sending Newsletters from Django

I am seeking advice from someone with experience integrating django and newsletters.
I need to send newsletters from my django app. I see that there are a couple of packages that already do this such as 'pennyblack' and 'emencia'. Does anyone have experience with these? Which of these is the most versatile and easy to use? My users want to add their own content to the news letters with topic, and article. News letters generally have 3 articles with a couple of photos. I also want the newsletter to print nicely as both html and pdf formats. Any working expamples I could toy with before I dive into the code?
Thanks!!
You can send html email messages directly from django with a few lines of python code, as in this snippet: http://www.djangofoo.com/250/sending-html-email. Or you can use an email sending module (I like django-messages - it allows for html and plaintext variants and gives you a message queue). Of course, that doesn't help you manage the newsletter, so you'd have to do that yourself and render an html template the same way you do with any webpage. I assume you've already checked google for newsletter-specific django modules with more features, but I don't know of any.
However, you probably don't want to send a newsletter yourself through django (more importantly, from your own production server). For one thing, if it's going to a lot of people, you don't want it to use all of your bandwidth and make your site sluggish while a huge queue of emails is sent. But more importantly, it's easy to get your server blacklisted by spam filters if you're not sending from a known, reputable domain (if you're paying for hosting it might be less of an issue, but you should check with your hosting provider).
IMO, your best bet is to use a stand-alone email newsletter service like MailChimp or Cheetah Mail. I've used and highly recommend MailChimp for a small to medium number of recipients, but I imagine there are a bunch of others that do that same thing. It makes organizing your message campaigns and recipient lists easy with hooks to do things like add a new user on your site to a recipient list. I'm sure you could also figure out a way to get your user-submitted content into the newsletter from django.
Hope that helps.
check this out. A better solution for you is django-newsletter

Why don't people use <CFLOGIN>?

Why don't people use CFLOGIN? I remember having problem with it with CF7 some months ago, but I couldn't remember what was wrong with it.
I use cflogin all the time and it works great. It can be a little tricky to get working the way you like, but the benefits are huge. Being able to fine tune your application with user roles takes care of the bulk of my rights based customization. There used to be some issues with session management that made it difficult to work with. Turning on j2ee sessions seems to make most of those issues go away.
Some of the popular frameworks are not compatible with cflogin, so that might be one reason you don't see a lot of it. They tend to have their own approach to securing application features.
I think a lot of people get frustrated with it because it is a little quirky and they give up on it. Others have more complicated security needs that aren't addressed completely by cflogin, so they wind up writing their own system. Specifically, there isn't an easy way to deal with rights by content asset.
The only issue I've had is with roles in CF8. It's brilliantly implemented, and a little cruel that it doesn't work as it quite should. Maybe in CF9.
In any event, building your own roles based system (assign the user a session variable with a comma separated list of access levels that the system can check against) isn't too hard to do and I got over it.
The one nice thing about cfLogin that is probably still worth using is how it ties into the Server monitor to see how many people are logged in, etc.
The point above about using the jsession is true, it's worth doing in all cf apps. One of the best things I dragged myself through to get working how I wanted it.
CFLogin is not used for 3 reasons.
First, it's a little touchy, a little strange, and doesn't work how many would think. You put some code here, and if a user isn't logged in it runs it... that's just odd, you know? It didn't help that there were some bugs early on, either.
Second, while it has the basic required security features for a web application, it doesn't go any further. You can't really extend it easily. Who's to say that's how everybody wants it?
Third, and most realistically, it's because people have already solved that problem. The problem area of securing an application, authentication and authorization has been thought out in the community long enough and most people know how to just do it. CFLogin is reinventing the door. It is too little, too late.
Now, that's not to say that no one uses it. I personally have used it a few times with basic success, but no reason to ring a bell. For most of my applications, it makes more sense to not use CFLogin. The problem domains are this way or that, and CFLogin doesn't always solve it in the most intelligent way.
Do keep in mind that CFLOGIN has a catch with Basic HTTP Auth where it can continue to send its UserID and Password even after you have called CFLOGOUT.
I know this has driven some advanced users away from it.
Here is an excerpt from LiveDocs
Caution: If you use web server-based
authentication or any form
authentication that uses a Basic HTTP
Authorization header, the browser
continues to send the authentication
information to your application until
the user closes the browser, or in
some cases, all open browser windows.
As a result, after the user logs out
and your application uses the cflogout
tag, until the browser closes, the
cflogin structure in the cflogin tag
will contain the logged-out user's
UserID and password. If a user logs
out and does not close the browser,
another user might access pages with
the first user's login.
In my case (suppose for some other people too) the main reason is moving from other platform, say PHP. I mean that I've already got some knowledge and habits in ACL development and started using them in CF.
I know how to make it handy for user, flexible for developer and secure and don't really need to switch to cflogin.
Sometimes the same happens with other stuff, say in most cases I prefer to implement client-side validation using own JS instead of using cfform/cfinput.
Because it (still!) has serious bugs, like this one:
http://www.raymondcamden.com/index.cfm/2009/8/7/Watch-out-for-this-CFLOGIN-Bug