## view code from django.core.mail import EmailMessage from django.template.loader import render_to_string ctx = { 'apartment': apartment } rendered = render_to_string('email/posted.html', ctx) code = apartment.listing_id() subject = "%s Your Listing has been Posted (LISTING ID: %s)"%(settings.EMAIL_SUBJECT_PREFIX, code) mail = EmailMessage(subject, rendered, to=[apartment.contact_email]) mail.send() ## template code

Dear Owner/Manager:

Your Listing has been posted! (Listing ID: {{apartment.listing_id}})
To edit or delete your listing please click on the links below:

edit listing delete listing

Your listing will expire within 14 days after it has been been posted but your are free to renew at any time until your apartment is leased. We hope you enjoy our free rental service and will continue to use us in the future to market your apartment rental for FREE!

Sincerely,

John Tilley & Sean Barry
-founders of Apartmentstein.com