簡體   English   中英

Django allauth電子郵件確認僅發送html代碼

[英]Django allauth Email confirmation sends only html code

我在Django==1.6.1上設置了我的django-allauth插件,一切正常,但是當我嘗試將確認消息更改為html時,它會發送HTML但只是代碼,它不顯示任何樣式或顏色,或圖像,這是我的模板代碼:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Confirma tu correo men</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body style="margin: 0; padding: 0;">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="810" style="border-collapse: collapse;">
<tr>
<td align="center" bgcolor="#2d96da" style="padding: 50px 45px 50px 45px;">
<img src="http://contratalos.s3.amazonaws.com/staticfiles/images/logo_beta.png" alt="Contratalos.com" width="300" height="201" style="display: block;" />
</td>
</tr>
<tr>
<td bgcolor="#000000;" style="color: #ffffff; font-family: Arial, sans-serif; font-size: 14px;">
<br/>
<a href="#" style="color: #ffffff;"><font color="#ffffff"> </font></a>  
</td>
</tr>
<tr>
<td style="color: #2d96da; font-family: Arial, sans-serif; font-size: 30px; padding: 90px 65px 90px 65px;">
Bienvenido a Contratalos.com<br/>
<font color="#000000" align="center">Verifica tu correo para que empieces a formar <br /> parte de nuestra comunidad 3.0</font>
<input type="submit" value="Verificar correo" width="300" height="35" style="color:#ffffff; font-size:23px; background-color:#5ac189; margin-top:45px; width: 288px; height: 45px;"><a href="{{ activate_url }}"></a>     </input>
</td>
</tr>
<tr>
<td bgcolor="#000000;" style="color: #ffffff; font-family: Arial, sans-serif; font-size: 14px; border:0px;">
Si no deseas seguir recibiendo nuestros correos, puedes editar tus preferencias de <a href="#" style="color: #ffffff;"><font color="#2d96da">notificaciones aqui</font></a>
<br/> Contratalos.com | Inversiones CTRL Venezuela, RIF : J-404528510 C.A., Caracas - Venezuela
</td>
</tr>
</table>
</body>
</html>

此代碼放在:

myapp/shared/templates/account/email/index.html

它包含在此.txt文件中:

  myapp/shared/templates/account/email/email_confirmation_signup_message.txt

像這樣:

{% include "account/email/index.html" %}

我把邏輯幾乎完全相同,只是將include標簽更改為index.html它實際發送它,但在雅虎電子郵件中我只看到模板的代碼,但沒有顏色,圖像等...

有人可以對此有所了解嗎?

提前致謝!

沒關系

我剛剛將.txt擴展名文件更改為.html

所以現在調用包含此html的文件:

myapp/shared/templates/account/email/email_confirmation_signup_message.html

像魅力一樣,謝謝你。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM