a few more templates
This commit is contained in:
@@ -631,7 +631,6 @@ def handle_sendemailcsv(first_name, last_name, email, csvfile,**kwargs):
|
||||
fullemail = first_name + " " + last_name + " " + "<" + email + ">"
|
||||
subject = "File from Rowsandall.com"
|
||||
|
||||
plaintext = get_template('csvemail.txt')
|
||||
htmly = get_template('csvemail.html')
|
||||
|
||||
d = {'first_name':first_name}
|
||||
@@ -1035,34 +1034,25 @@ def handle_sendemail_invite(email, name, code, teamname, manager,
|
||||
debug=False,**kwargs):
|
||||
fullemail = name + ' <' + email + '>'
|
||||
subject = 'Invitation to join team ' + teamname
|
||||
message = 'Dear ' + name + ',\n\n'
|
||||
message += manager + ' is inviting you to join his team ' + teamname
|
||||
message += ' on rowsandall.com\n\n'
|
||||
message += 'By accepting the invite, you will have access to your'
|
||||
message += " team's workouts on rowsandall.com and your workouts will "
|
||||
message += " be visible to "
|
||||
message += "the members of the team.\n\n"
|
||||
message += "By accepting the invite, you are agreeing with the sharing "
|
||||
message += "of personal data according to our privacy policy.\n\n"
|
||||
message += 'If you already have an account on rowsandall.com, you can login to the site and you will find the invitation here on the Teams page:\n'
|
||||
message += ' https://rowsandall.com/rowers/me/teams \n\n'
|
||||
message += 'You can also click the direct link: \n'
|
||||
message += 'https://rowsandall.com/rowers/me/invitation/' + code + ' \n\n'
|
||||
message += 'If you are not yet registered to rowsandall.com, '
|
||||
message += 'you can register for free at https://rowsandall.com/rowers/register\n'
|
||||
message += 'After you set up your account, you can use the direct link: '
|
||||
message += 'https://rowsandall.com/rowers/me/invitation/' + code + ' \n\n'
|
||||
|
||||
message += 'You can also manually accept your team membership with the code.\n'
|
||||
message += 'You will need to do this if you registered under a different email address than this one.\n'
|
||||
message += 'Code: ' + code + '\n'
|
||||
message += 'Link to manually accept your team membership: '
|
||||
message += 'https://rowsandall.com/rowers/me/invitation\n\n'
|
||||
message += "Best Regards, the Rowsandall Team"
|
||||
siteurl = SITE_URL
|
||||
if debug:
|
||||
siteurl = SITE_URL_DEV
|
||||
|
||||
email = EmailMessage(subject, message,
|
||||
'Rowsandall <info@rowsandall.com>',
|
||||
[fullemail])
|
||||
htmly = get_template('teaminviteemail.html')
|
||||
|
||||
d = {
|
||||
'name':name,
|
||||
'manage':manager,
|
||||
'code':code,
|
||||
'teamname':teamname,
|
||||
}
|
||||
|
||||
html_content = htmly.render(d)
|
||||
text_content = textify(html_content)
|
||||
|
||||
msg = EmailMultiAlternatives(subject, text_content, from_email, [fullemail])
|
||||
msg.attach_alternative(html_content, "text/html")
|
||||
|
||||
if 'emailbounced' in kwargs:
|
||||
emailbounced = kwargs['emailbounced']
|
||||
@@ -1070,7 +1060,7 @@ def handle_sendemail_invite(email, name, code, teamname, manager,
|
||||
emailbounced = False
|
||||
|
||||
if not emailbounced:
|
||||
res = email.send()
|
||||
res = msg.send()
|
||||
|
||||
|
||||
return 1
|
||||
@@ -1085,25 +1075,33 @@ def handle_sendemailnewresponse(first_name, last_name,
|
||||
workoutname, workoutid, commentid,
|
||||
debug=False,**kwargs):
|
||||
fullemail = first_name + ' ' + last_name + ' <' + email + '>'
|
||||
from_email = 'Rowsandall <info@rowsandall.com>'
|
||||
subject = 'New comment on workout ' + workoutname
|
||||
message = 'Dear ' + first_name + ',\n\n'
|
||||
message += commenter_first_name + ' ' + commenter_last_name
|
||||
message += ' has written a new comment on the workout '
|
||||
message += workoutname + '\n\n'
|
||||
message += comment
|
||||
message += '\n\n'
|
||||
message += 'You can read the comment here:\n'
|
||||
message += 'https://rowsandall.com/rowers/workout/' + \
|
||||
str(workoutid) + '/comment'
|
||||
message += '\n\n'
|
||||
message += 'You are receiving this email because you are subscribed '
|
||||
message += 'to comments on this workout. To unsubscribe, follow this link:\n'
|
||||
message += 'https://rowsandall.com/rowers/workout/' + \
|
||||
str(workoutid) + '/unsubscribe'
|
||||
|
||||
email = EmailMessage(subject, message,
|
||||
'Rowsandall <info@rowsandall.com>',
|
||||
[fullemail])
|
||||
siteurl = SITE_URL
|
||||
if debug:
|
||||
siteurl = SITE_URL_DEV
|
||||
|
||||
|
||||
htmly = get_template('teamresponseemail.html')
|
||||
|
||||
d = {
|
||||
'first_name':first_name,
|
||||
'commenter_first_name':commenter_first_name,
|
||||
'commenter_last_name':commenter_last_name,
|
||||
'comment':comment,
|
||||
'workoutname':workoutname,
|
||||
'siteurl':siteurl,
|
||||
'workoutid':workoutid,
|
||||
'commentid':commentid
|
||||
}
|
||||
|
||||
html_content = htmly.render(d)
|
||||
text_content = textify(html_content)
|
||||
|
||||
msg = EmailMultiAlternatives(subject, text_content, from_email, [fullemail])
|
||||
msg.attach_alternative(html_content, "text/html")
|
||||
|
||||
|
||||
if 'emailbounced' in kwargs:
|
||||
emailbounced = kwargs['emailbounced']
|
||||
@@ -1111,7 +1109,7 @@ def handle_sendemailnewresponse(first_name, last_name,
|
||||
emailbounced = False
|
||||
|
||||
if not emailbounced:
|
||||
res = email.send()
|
||||
res = msg.send()
|
||||
|
||||
|
||||
return 1
|
||||
|
||||
58
rowers/templates/teaminviteemail.html
Normal file
58
rowers/templates/teaminviteemail.html
Normal file
@@ -0,0 +1,58 @@
|
||||
{% extends "emailbase.html" %}
|
||||
{% load staticfiles %}
|
||||
{% load rowerfilters %}
|
||||
|
||||
{% block body %}
|
||||
<p>Dear <strong>{{ name }}</strong>,</p>
|
||||
|
||||
<p>
|
||||
{{ manager }} is inviting you to join his team {{ teamname }}
|
||||
on rowsandall.com
|
||||
</p>
|
||||
<p>
|
||||
By accepting the invite, you will have access to your
|
||||
team's workouts on rowsandall.com and your workouts will
|
||||
be visible to
|
||||
the members of the team.
|
||||
</p>
|
||||
<p>
|
||||
By accepting the invite, you are agreeing with the sharing
|
||||
of personal data according to our privacy policy.
|
||||
</p>
|
||||
<p>
|
||||
If you already have an account on rowsandall.com, you can login to the
|
||||
site and you will find the invitation here on the Teams page:
|
||||
<a href="{{ siteurl }}/rowers/me/teams">{{ siteurl }}/rowers/me/teams</a>
|
||||
</p>
|
||||
<p>
|
||||
You can also click the direct link:
|
||||
<a href="{{ siteurl }}/rowers/me/invitation/{{ code }}">
|
||||
{{ siteurl }}/rowers/me/invitation/{{ code }}</a>
|
||||
</p>
|
||||
<p>
|
||||
If you are not yet registered to rowsandall.com,
|
||||
you can register for free at
|
||||
<a href="{{ siteurl }}/rowers/register">{{ siteurl }}/rowers/register</a>
|
||||
</p>
|
||||
<p>
|
||||
After you set up your account, you can use the direct link:
|
||||
<a href="{{ siteurl }}/rowers/me/invitation/{{ code }}">
|
||||
{{ siteurl }}/rowers/me/invitation/{{ code }}</a>
|
||||
</p>
|
||||
<p>
|
||||
You can also manually accept your team membership with the code.
|
||||
You will need to do this if you registered under a different email address than this one.
|
||||
</p>
|
||||
<p>
|
||||
Code: {{ code }}
|
||||
</p>
|
||||
<p>
|
||||
Link to manually accept your team membership:
|
||||
<a href="{{ siteurl }}/rowers/me/invitation">
|
||||
{{ siteurl }}/rowers/me/invitation</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Best Regards, the Rowsandall Team
|
||||
</p>
|
||||
{% endblock %}
|
||||
26
rowers/templates/teamresponseemail.html
Normal file
26
rowers/templates/teamresponseemail.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% extends "emailbase.html" %}
|
||||
{% load staticfiles %}
|
||||
{% load rowerfilters %}
|
||||
|
||||
{% block body %}
|
||||
<p>Dear <strong>{{ name }}</strong>,</p>
|
||||
|
||||
<p>
|
||||
{{ commenter_first_name }} {{ commenter_last_name }} has written
|
||||
a new comment on your workout {{ workoutname }}
|
||||
</p>
|
||||
<p>
|
||||
{{ comment }}
|
||||
</p>
|
||||
<p>
|
||||
You can read the comment here:
|
||||
</p>
|
||||
<p>
|
||||
<a href="{{ siteurl }}/rowers/workout/{{ workoutid }}/comment">
|
||||
{{ siteurl }}/rowers/workout/{{ workoutid }}/comment</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Best Regards, the Rowsandall Team
|
||||
</p>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user