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 + ">"
|
fullemail = first_name + " " + last_name + " " + "<" + email + ">"
|
||||||
subject = "File from Rowsandall.com"
|
subject = "File from Rowsandall.com"
|
||||||
|
|
||||||
plaintext = get_template('csvemail.txt')
|
|
||||||
htmly = get_template('csvemail.html')
|
htmly = get_template('csvemail.html')
|
||||||
|
|
||||||
d = {'first_name':first_name}
|
d = {'first_name':first_name}
|
||||||
@@ -1035,34 +1034,25 @@ def handle_sendemail_invite(email, name, code, teamname, manager,
|
|||||||
debug=False,**kwargs):
|
debug=False,**kwargs):
|
||||||
fullemail = name + ' <' + email + '>'
|
fullemail = name + ' <' + email + '>'
|
||||||
subject = 'Invitation to join team ' + teamname
|
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'
|
siteurl = SITE_URL
|
||||||
message += 'You will need to do this if you registered under a different email address than this one.\n'
|
if debug:
|
||||||
message += 'Code: ' + code + '\n'
|
siteurl = SITE_URL_DEV
|
||||||
message += 'Link to manually accept your team membership: '
|
|
||||||
message += 'https://rowsandall.com/rowers/me/invitation\n\n'
|
|
||||||
message += "Best Regards, the Rowsandall Team"
|
|
||||||
|
|
||||||
email = EmailMessage(subject, message,
|
htmly = get_template('teaminviteemail.html')
|
||||||
'Rowsandall <info@rowsandall.com>',
|
|
||||||
[fullemail])
|
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:
|
if 'emailbounced' in kwargs:
|
||||||
emailbounced = kwargs['emailbounced']
|
emailbounced = kwargs['emailbounced']
|
||||||
@@ -1070,7 +1060,7 @@ def handle_sendemail_invite(email, name, code, teamname, manager,
|
|||||||
emailbounced = False
|
emailbounced = False
|
||||||
|
|
||||||
if not emailbounced:
|
if not emailbounced:
|
||||||
res = email.send()
|
res = msg.send()
|
||||||
|
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
@@ -1085,25 +1075,33 @@ def handle_sendemailnewresponse(first_name, last_name,
|
|||||||
workoutname, workoutid, commentid,
|
workoutname, workoutid, commentid,
|
||||||
debug=False,**kwargs):
|
debug=False,**kwargs):
|
||||||
fullemail = first_name + ' ' + last_name + ' <' + email + '>'
|
fullemail = first_name + ' ' + last_name + ' <' + email + '>'
|
||||||
|
from_email = 'Rowsandall <info@rowsandall.com>'
|
||||||
subject = 'New comment on workout ' + workoutname
|
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,
|
siteurl = SITE_URL
|
||||||
'Rowsandall <info@rowsandall.com>',
|
if debug:
|
||||||
[fullemail])
|
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:
|
if 'emailbounced' in kwargs:
|
||||||
emailbounced = kwargs['emailbounced']
|
emailbounced = kwargs['emailbounced']
|
||||||
@@ -1111,7 +1109,7 @@ def handle_sendemailnewresponse(first_name, last_name,
|
|||||||
emailbounced = False
|
emailbounced = False
|
||||||
|
|
||||||
if not emailbounced:
|
if not emailbounced:
|
||||||
res = email.send()
|
res = msg.send()
|
||||||
|
|
||||||
|
|
||||||
return 1
|
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