 <p>A better solution would be to use the django template system. Have the user enter the message in django template format like: Dear {{contactname}}, This is your booking confirmation for your vacation from {{startdate}} to {{enddate}} for a total of {{numdays}} days. Please click {{cancellink}} to cancel your booking.</p> <p>And then use <code>get_template_from_string</code> from <code>django.template.loader</code> and get a template instance. Than you can render the template by doing template.render(context), Where context is a <code>Context</code> instance found in <code>django.template.context</code>. You can read more about django template api in <a href="https://docs.djangoproject.com/en/1.6/ref/templates/api/" rel="nofollow">https://docs.djangoproject.com/en/1.6/ref/templates/api/</a> Should be simple from here.</p>