(imported from commit 1132553b63ae23ebcca746f0f65205b97bfee7dc)
This commit is contained in:
acrefoot
2013-11-15 18:54:12 -05:00
committed by Tim Abbott
parent ccb7446d5c
commit daffe049ad
17 changed files with 79 additions and 46 deletions

View File

@@ -30,6 +30,8 @@ def confirm(request, confirmation_key):
'days': getattr(settings, 'EMAIL_CONFIRMATION_DAYS', 10), 'days': getattr(settings, 'EMAIL_CONFIRMATION_DAYS', 10),
'key': confirmation_key, 'key': confirmation_key,
'full_name': request.GET.get("full_name", None), 'full_name': request.GET.get("full_name", None),
'support_email': settings.ZULIP_ADMINISTRATOR,
'enterprise': settings.ENTERPRISE
} }
templates = [ templates = [
'confirmation/confirm.html', 'confirmation/confirm.html',

View File

@@ -10,12 +10,19 @@
<p class="lead">Whoops, something's not right. We couldn't find your confirmation ID!<p> <p class="lead">Whoops, something's not right. We couldn't find your confirmation ID!<p>
{% if enterprise % }
<p>Make sure you copied the link correctly in to your browser.<p>
<p>If you're still having problems, please contact your Zulip administrator at <a
href="mailto:{{ support_email }}">{{ support_email }}</a>.</p>
{% else % }
<p>Make sure you copied the link correctly in to your browser. If you're <p>Make sure you copied the link correctly in to your browser. If you're
still encountering this page, its probably our fault. We're sorry.<p> still encountering this page, its probably our fault. We're sorry.<p>
<p>Anyway, shoot us a line at <a <p>Anyway, shoot us a line at <a
href="mailto:support@zulip.com">support@zulip.com</a> and we'll get href="mailto:{{ support_email }}">{{ support_email }}</a> and we'll get
this resolved shortly.</p> this resolved shortly.</p>
{% endif %}
{% endif %} {% endif %}
</div> </div>

View File

@@ -5,7 +5,7 @@ Hi there,
To get started, visit the link below: To get started, visit the link below:
<{{ activate_url }}> <{{ activate_url }}>
Feel free to give us a shout at <support@zulip.com> if you have any questions. Feel free to give us a shout at <{{ support_email }}> if you have any questions.
Cheers, Cheers,

View File

@@ -5,7 +5,7 @@ Hi there,
To get started, visit the link below: To get started, visit the link below:
<{{ activate_url }}> <{{ activate_url }}>
Feel free to give us a shout at <support@zulip.com> if you have any questions. Feel free to give us a shout at <{{ support_email }}> if you have any questions.
Cheers, Cheers,

View File

@@ -5,7 +5,11 @@ You recently signed up for Zulip. Awesome!
To complete signup, visit this link below: To complete signup, visit this link below:
<{{ activate_url }}> <{{ activate_url }}>
Feel free to give us a shout at <support@zulip.com> if you have any questions. {% if enterprise %}
If you are having issues, please contact your Zulip administrator at <{{ support_email }}>.
{% else %}
Feel free to give us a shout at <{{ support_email }}> if you have any questions.
{% endif %}
Cheers, Cheers,

View File

@@ -6,7 +6,7 @@ Mail sent to a user who hasn't logged in for 24 hours.
Hello {{ name }}, Hello {{ name }},
A lot has happened on Zulip while you've been away! Visit A lot has happened on Zulip while you've been away! Visit
https://zulip.com to catch up. https://{{ external_host }} to catch up.
{% if unread_pms %} {% if unread_pms %}
** Missed private messages ** ** Missed private messages **
@@ -19,7 +19,7 @@ You have some missed private messages. Here are some of them:
{% endfor %} {% endfor %}
{% endfor %}{% endfor %} {% endfor %}{% endfor %}
{% if remaining_unread_pm_count > 0 %}+ {{ remaining_unread_pm_count }} more new private message{{ remaining_unread_pm_count|pluralize }}{% endif %} {% if remaining_unread_pm_count > 0 %}+ {{ remaining_unread_pm_count }} more new private message{{ remaining_unread_pm_count|pluralize }}{% endif %}
Catch up on the rest of your PMs: https://zulip.com/#narrow/is/private"{% endif %} Catch up on the rest of your PMs: https://{{ external_host }}/#narrow/is/private"{% endif %}
{% if hot_conversations %} {% if hot_conversations %}
** Hot conversations ** ** Hot conversations **
@@ -34,7 +34,7 @@ been gone:
{% endfor %}{% endfor %} {% endfor %}{% endfor %}
{% if convo.count > 0 %}+ {{ convo.count }} more message{{ convo.count|pluralize }} by {{ convo.participants|display_list:4 }}.{% endif %} {% if convo.count > 0 %}+ {{ convo.count }} more message{{ convo.count|pluralize }} by {{ convo.participants|display_list:4 }}.{% endif %}
{% endfor %}{% endfor %} {% endfor %}{% endfor %}
Catch up on the rest of these conversations: https://zulip.com.{% endif %} Catch up on the rest of these conversations: https://{{ external_host }}.{% endif %}
{% if new_users and new_streams.plain %}** Group updates **{% elif new_users %}** New users **{% elif new_streams.plain %}** New streams **{% endif %} {% if new_users and new_streams.plain %}** Group updates **{% elif new_users %}** New users **{% elif new_streams.plain %}** New streams **{% endif %}
@@ -43,13 +43,13 @@ Catch up on the rest of these conversations: https://zulip.com.{% endif %}
{{ new_streams.plain|display_list:4 }}. {{ new_streams.plain|display_list:4 }}.
Visit your Streams page to subscribe: https://zulip.com/#subscriptions.{% endif %} Visit your Streams page to subscribe: https://{{ external_host }}/#subscriptions.{% endif %}
{% if new_users %}{% if new_streams.plain or unread_pms or hot_conversations %}And finally, please{% else %}Please{% endif %} welcome {{ new_users|display_list:4 }} to Zulip!{% endif %} {% if new_users %}{% if new_streams.plain or unread_pms or hot_conversations %}And finally, please{% else %}Please{% endif %} welcome {{ new_users|display_list:4 }} to Zulip!{% endif %}
Click here to log in to Zulip and catch up: https://zulip.com. Click here to log in to Zulip and catch up: https://{{ external_host }}.
Cheers, Cheers,
The Zulip Team The Zulip Team
To disable future email notifications, please visit https://zulip.com/#settings. To disable future email notifications, please visit https://{{ external_host }}/#settings.

View File

@@ -5,7 +5,7 @@ Mail sent to a user who hasn't logged in for 24 hours.
Hello {{ name }}, Hello {{ name }},
<p>A lot has happened on Zulip while you've been away! <a href="https://zulip.com">Visit Zulip</a> to catch up.</p> <p>A lot has happened on Zulip while you've been away! <a href="https://{{ external_host }}">Visit Zulip</a> to catch up.</p>
{% if unread_pms %} {% if unread_pms %}
<h2>Missed private messages</h2> <h2>Missed private messages</h2>
@@ -28,7 +28,7 @@ Hello {{ name }},
{% endfor %} {% endfor %}
{% if remaining_unread_pm_count > 0 %}<p>+ {{ remaining_unread_pm_count }} more new private message{{ remaining_unread_pm_count|pluralize }}</p>{% endif %} {% if remaining_unread_pm_count > 0 %}<p>+ {{ remaining_unread_pm_count }} more new private message{{ remaining_unread_pm_count|pluralize }}</p>{% endif %}
<p><a href="https://zulip.com/#narrow/is/private">Catch up on the rest of your PMs.</a></p> <p><a href="https://{{ external_host }}/#narrow/is/private">Catch up on the rest of your PMs.</a></p>
</div> </div>
{% endif %} {% endif %}
@@ -60,7 +60,7 @@ Here are some of the hot conversations that have happened while you've been gone
{% endfor %} {% endfor %}
</div> </div>
{% endfor %} {% endfor %}
<p><a href="https://zulip.com/">Catch up on the rest of these conversations.</a></p> <p><a href="https://{{ external_host }}">Catch up on the rest of these conversations.</a></p>
{% endif %} {% endif %}
@@ -80,7 +80,7 @@ Here are some of the hot conversations that have happened while you've been gone
<p>{{ new_streams.html|display_list:4|safe }}.</p> <p>{{ new_streams.html|display_list:4|safe }}.</p>
<p>Click on {% if new_stream_count > 1 %}a{% else %}the{% endif %} name to check out some of the traffic, or visit your <a href="https://zulip.com/#subscriptions">Streams page</a> to subscribe.</p> <p>Click on {% if new_stream_count > 1 %}a{% else %}the{% endif %} name to check out some of the traffic, or visit your <a href="https://{{ external_host }}/#subscriptions">Streams page</a> to subscribe.</p>
{% endif %} {% endif %}
{% if new_users %} {% if new_users %}
@@ -89,11 +89,11 @@ Here are some of the hot conversations that have happened while you've been gone
<br /> <br />
<p><a href="https://zulip.com">Click here to log in to Zulip and catch up.</a></p> <p><a href="https://{{ external_host }}">Click here to log in to Zulip and catch up.</a></p>
<p>Cheers, <p>Cheers,
<br> <br>
The Zulip Team</p> The Zulip Team</p>
<p>To disable future email notifications, please visit your <a <p>To disable future email notifications, please visit your <a
href="https://zulip.com/#settings">Zulip Settings page</a>.</p> href="https://{{ external_host }}/#settings">Zulip Settings page</a>.</p>

View File

@@ -7,7 +7,7 @@
<body> <body>
<table width="80%" style="align:center; max-width:800px" align="center"> <table width="80%" style="align:center; max-width:800px" align="center">
<tr><td> <tr><td>
<a href="https://zulip.com/"><img style="max-height:75px; height:75px;" height="75px" alt="Zulip" title="Zulip" src="https://zulip.com/static/images/landing-page/zulip-header.png" /></a> <a href="https://{{ external_host }}/"><img style="max-height:75px; height:75px;" height="75px" alt="Zulip" title="Zulip" src="https://{{ external_host }}/static/images/landing-page/zulip-header.png" /></a>
<h3 style="font-family:Arial; font-size:30px; margin: 5px 0px; color:#555">we love our users</h3> <h3 style="font-family:Arial; font-size:30px; margin: 5px 0px; color:#555">we love our users</h3>
</td></tr> </td></tr>
@@ -17,10 +17,10 @@
<p>Welcome to Zulip!</p> <p>Welcome to Zulip!</p>
<p><a href="https://zulip.com/hello" style="color:#08c">zulip.com/hello</a> has a nice overview of what we're up to, but here are a few tips that'll help you get the most out of it:</p> <p><a href="https://{{ external_host }}/hello" style="color:#08c">{{ external_host }}/hello</a> has a nice overview of what we're up to, but here are a few tips that'll help you get the most out of it:</p>
<ol> <ol>
<li>Zulip works best when it's always open, so <a href="https://zulip.com/apps" style="color:#08c">grab our apps</a>! (Mac, Windows, Linux, Android, iOS)</li> <li>Zulip works best when it's always open, so <a href="https://{{ external_host }}/apps" style="color:#08c">grab our apps</a>! (Mac, Windows, Linux, Android, iOS)</li>
<li>Keyboard shortcuts: learn about them in the Keyboard Shortcuts tab under the gear icon. (Or press '?')</li> <li>Keyboard shortcuts: learn about them in the Keyboard Shortcuts tab under the gear icon. (Or press '?')</li>
@@ -34,12 +34,14 @@ def fn(arg):
<pre style="padding:9.5px; background-color:#f5f5f5; border-radius:4px; border:1px solid rgba(0,0,0,0.15); font-family:Monaco,Menlo,Consolas,'Courier New',monospace"><span style="color:#008000; font-weight:bold">def</span> <span style="color:#00f">fn</span>(arg): <pre style="padding:9.5px; background-color:#f5f5f5; border-radius:4px; border:1px solid rgba(0,0,0,0.15); font-family:Monaco,Menlo,Consolas,'Courier New',monospace"><span style="color:#008000; font-weight:bold">def</span> <span style="color:#00f">fn</span>(arg):
<span style="color:#008000; font-weight:bold">print</span> <span style="color:#ba2121">"Hello"</span></pre> <span style="color:#008000; font-weight:bold">print</span> <span style="color:#ba2121">"Hello"</span></pre>
</li> </li>
<li>Got automation? Check out <a href="https://zulip.com/integrations" style="color:#08c">our integrations</a> and <a href="https://zulip.com/api" style="color:#08c">API</a> for easy integration with services like GitHub, Jenkins, Nagios, and Trac. They're super-easy to set up and make things a lot more useful.</li> <li>Got automation? Check out <a href="https://{{ external_host }}/integrations" style="color:#08c">our integrations</a> and <a href="https://{{ external_host }}/api" style="color:#08c">API</a> for easy integration with services like GitHub, Jenkins, Nagios, and Trac. They're super-easy to set up and make things a lot more useful.</li>
<li>Emoji. Because <pre style="display:inline; color:#D14; padding:2px 4px; background-color:#f5f5f5; border-radius:4px; border:1px solid rgba(0,0,0,0.15); font-family:Monaco,Menlo,Consolas,'Courier New',monospace">:ramen:</pre> means <img src="https://zulip.com/static/third/gemoji/images/emoji/ramen.png" style="max-height:20px; height:20px;" height="20px" />.</li> <li>Emoji. Because <pre style="display:inline; color:#D14; padding:2px 4px; background-color:#f5f5f5; border-radius:4px; border:1px solid rgba(0,0,0,0.15); font-family:Monaco,Menlo,Consolas,'Courier New',monospace">:ramen:</pre> means <img src="https://{{ external_host }}/static/third/gemoji/images/emoji/ramen.png" style="max-height:20px; height:20px;" height="20px" />.</li>
</ol> </ol>
{% if enterprise is False %}
<p>Zulip is under active development, and we have a team of engineers standing by to respond to your feedback, so please report bugs and let us know what you think! There's a feedback tab under the gear icon in the upper-right corner, or you can e-mail us at <a href="mailto:feedback@zulip.com" style="color:#08c">feedback@zulip.com</a>.</p> <p>Zulip is under active development, and we have a team of engineers standing by to respond to your feedback, so please report bugs and let us know what you think! There's a feedback tab under the gear icon in the upper-right corner, or you can e-mail us at <a href="mailto:feedback@zulip.com" style="color:#08c">feedback@zulip.com</a>.</p>
{% endif %}
</p>-Waseem, for the Zulip team</p> </p>-Waseem, for the Zulip team</p>
</td></tr> </td></tr>

View File

@@ -20,7 +20,7 @@ https://zulip.com/hello has a nice overview of what we're up to, but here are a
4. Got automation? Check out https://zulip.com/integrations and https://zulip.com/api for easy integration with services like GitHub, Jenkins, Nagios, and Trac. They're super-easy to set up and make things a lot more useful. 4. Got automation? Check out https://zulip.com/integrations and https://zulip.com/api for easy integration with services like GitHub, Jenkins, Nagios, and Trac. They're super-easy to set up and make things a lot more useful.
5. Emoji. Because :ramen: 5. Emoji. Because :ramen:
{% if enterprise is False %}
Zulip is under active development, and we have a team of engineers standing by to respond to your feedback, so please report bugs and let us know what you think! There's a feedback tab under the gear icon in the upper-right corner, or you can e-mail us at feedback@zulip.com. Zulip is under active development, and we have a team of engineers standing by to respond to your feedback, so please report bugs and let us know what you think! There's a feedback tab under the gear icon in the upper-right corner, or you can e-mail us at feedback@zulip.com.
{% endif %}
-Waseem, for the Zulip team -Waseem, for the Zulip team

View File

@@ -7,7 +7,7 @@
<body> <body>
<table width="80%" style="align:center; max-width:800px" align="center"> <table width="80%" style="align:center; max-width:800px" align="center">
<tr><td> <tr><td>
<a href="https://zulip.com/"><img style="max-height:75px; height:75px;" height="75px" alt="Zulip" title="Zulip" src="https://zulip.com/static/images/landing-page/zulip-header.png" /></a> <a href="https://{{ external_host }}/"><img style="max-height:75px; height:75px;" height="75px" alt="Zulip" title="Zulip" src="https://{{ external_host }}/static/images/landing-page/zulip-header.png" /></a>
<h3 style="font-family:Arial; font-size:30px; margin: 5px 0px; color:#555">one last thing</h3> <h3 style="font-family:Arial; font-size:30px; margin: 5px 0px; color:#555">one last thing</h3>
</td></tr> </td></tr>
@@ -28,7 +28,7 @@ and <b>topics</b>.</p>
<li>Bad topics: "What do people think of this?" "Where should we go to lunch?"</li> <li>Bad topics: "What do people think of this?" "Where should we go to lunch?"</li>
</ul> </ul>
<p><a href="https://zulip.com">Try it out now!</a></p> <p><a href="https://{{ external_host }}">Try it out now!</a></p>
<p>-Waseem, for the Zulip team</p> <p>-Waseem, for the Zulip team</p>
</td></tr> </td></tr>

View File

@@ -16,6 +16,6 @@ Some tips:
* Bad topics: "What do people think of this?" "Where should we go to lunch?" * Bad topics: "What do people think of this?" "Where should we go to lunch?"
Try it out now! https://zulip.com Try it out now! https://{{ external_host }}
-Waseem, for the Zulip team -Waseem, for the Zulip team

View File

@@ -7,7 +7,7 @@
<body> <body>
<table width="80%" style="align:center; max-width:800px" align="center"> <table width="80%" style="align:center; max-width:800px" align="center">
<tr><td> <tr><td>
<a href="https://zulip.com/hello"><img style="max-height:75px; height:75px;" height="75px" alt="Zulip" title="Zulip" src="https://zulip.com/static/images/landing-page/zulip-header.png" /></a> <a href="https://{{ external_host }}/hello"><img style="max-height:75px; height:75px;" height="75px" alt="Zulip" title="Zulip" src="https://{{ external_host }}/static/images/landing-page/zulip-header.png" /></a>
<h3 style="font-family:Arial; font-size:30px; margin: 5px 0px; color:#555">you're busy: we get you</h3> <h3 style="font-family:Arial; font-size:30px; margin: 5px 0px; color:#555">you're busy: we get you</h3>
</td></tr> </td></tr>
@@ -20,7 +20,11 @@
<p>To get started, visit the link below:<br /> <p>To get started, visit the link below:<br />
<a href="{{ activate_url }}" style="color:#08c">{{ activate_url }}</a></p> <a href="{{ activate_url }}" style="color:#08c">{{ activate_url }}</a></p>
<p>We're here for you at <a href="mailto:support@zulip.com" style="color:#08c">support@zulip.com</a>, if you have any questions.</p> {% if enterprise %}
<p>If you are having issues, please contact your Zulip administrator at <a href="mailto:{{ support_email }}" style="color:#08c">{{ support_email }}</a>.</p>
{% else %}
<p>We're here for you at <a href="mailto:{{ support_email }}" style="color:#08c">{{ support_email }}</a>, if you have any questions.</p>
{% endif %}
</p>Cheers,<br /> </p>Cheers,<br />
The Zulip Team</p> The Zulip Team</p>

View File

@@ -5,7 +5,11 @@ This is a friendly reminder that {{ referrer.full_name }} ({{ referrer.email }})
To get started, visit the link below: To get started, visit the link below:
<{{ activate_url }}> <{{ activate_url }}>
We're here for you at <support@zulip.com>, if you have any questions. {% if enterprise %}
If you are having issues, please contact your Zulip administrator at <{{ support_email }}>.
{% else %}
We're here for you at <{{ support_email }}>, if you have any questions.
{% endif %}
Cheers, Cheers,
The Zulip Team The Zulip Team

View File

@@ -30,4 +30,4 @@ The Zulip Team
Note: click here to open your Zulip Settings page and disable future email notifications: Note: click here to open your Zulip Settings page and disable future email notifications:
https://zulip.com/#settings https://{{ external_url }}/#settings

View File

@@ -1757,13 +1757,16 @@ def do_send_confirmation_email(invitee, referrer):
""" """
subject_template_path = 'confirmation/invite_email_subject.txt' subject_template_path = 'confirmation/invite_email_subject.txt'
body_template_path = 'confirmation/invite_email_body.txt' body_template_path = 'confirmation/invite_email_body.txt'
context = {'referrer': referrer,
'support_email': settings.ZULIP_ADMINISTRATOR,
'enterprise': settings.ENTERPRISE}
if referrer.realm.domain == 'mit.edu': if referrer.realm.domain == 'mit.edu':
subject_template_path = 'confirmation/mituser_invite_email_subject.txt' subject_template_path = 'confirmation/mituser_invite_email_subject.txt'
body_template_path = 'confirmation/mituser_invite_email_body.txt' body_template_path = 'confirmation/mituser_invite_email_body.txt'
Confirmation.objects.send_confirmation( Confirmation.objects.send_confirmation(
invitee, invitee.email, additional_context={'referrer': referrer}, invitee, invitee.email, additional_context=context,
subject_template_path=subject_template_path, subject_template_path=subject_template_path,
body_template_path=body_template_path) body_template_path=body_template_path)
@@ -1775,15 +1778,15 @@ def hashchange_encode(string):
def pm_narrow_url(participants): def pm_narrow_url(participants):
participants.sort() participants.sort()
base_url = "https://zulip.com/#narrow/pm-with/" base_url = "https://%s/#narrow/pm-with/" % (settings.EXTERNAL_HOST,)
return base_url + hashchange_encode(",".join(participants)) return base_url + hashchange_encode(",".join(participants))
def stream_narrow_url(stream): def stream_narrow_url(stream):
base_url = "https://zulip.com/#narrow/stream/" base_url = "https://%s/#narrow/stream/" % (settings.EXTERNAL_HOST,)
return base_url + hashchange_encode(stream) return base_url + hashchange_encode(stream)
def topic_narrow_url(stream, topic): def topic_narrow_url(stream, topic):
base_url = "https://zulip.com/#narrow/stream/" base_url = "https://%s/#narrow/stream/" % (settings.EXTERNAL_HOST,)
return "%s%s/topic/%s" % (base_url, hashchange_encode(stream), return "%s%s/topic/%s" % (base_url, hashchange_encode(stream),
hashchange_encode(topic)) hashchange_encode(topic))
@@ -1895,8 +1898,9 @@ def do_send_missedmessage_events(user_profile, missed_messages):
template_payload = {'name': user_profile.full_name, template_payload = {'name': user_profile.full_name,
'messages': build_message_list(user_profile, missed_messages), 'messages': build_message_list(user_profile, missed_messages),
'message_count': len(missed_messages), 'message_count': len(missed_messages),
'url': 'https://zulip.com', 'url': 'https://%s' % (settings.EXTERNAL_URL,),
'reply_warning': False} 'reply_warning': False,
'externl_host': settings.EXTERNAL_URL}
headers = {} headers = {}
if all(msg.recipient.type in (Recipient.HUDDLE, Recipient.PERSONAL) if all(msg.recipient.type in (Recipient.HUDDLE, Recipient.PERSONAL)
for msg in missed_messages): for msg in missed_messages):
@@ -1917,10 +1921,10 @@ def do_send_missedmessage_events(user_profile, missed_messages):
# There are some @-mentions mixed in with personals # There are some @-mentions mixed in with personals
template_payload['mention'] = True template_payload['mention'] = True
template_payload['reply_warning'] = True template_payload['reply_warning'] = True
headers['Reply-To'] = "Nobody <noreply@zulip.com>" headers['Reply-To'] = "Nobody <%>" % (settings.NOREPLY_EMAIL_ADDRESS,)
subject = "Missed Zulip%s from %s" % (plural_messages, sender_str) subject = "Missed Zulip%s from %s" % (plural_messages, sender_str)
from_email = "%s (via Zulip) <noreply@zulip.com>" % (sender_str) from_email = "%s (via Zulip) <%>" % (sender_str, settings.NOREPLY_EMAIL_ADDRESS)
text_content = loader.render_to_string('zerver/missed_message_email.txt', template_payload) text_content = loader.render_to_string('zerver/missed_message_email.txt', template_payload)
html_content = loader.render_to_string('zerver/missed_message_email_html.txt', template_payload) html_content = loader.render_to_string('zerver/missed_message_email_html.txt', template_payload)
@@ -2147,7 +2151,8 @@ def send_future_email(recipients, email_html, email_text, subject,
# Zulip Enterprise implementation # Zulip Enterprise implementation
if not mail_client: if not mail_client:
if sender is None: if sender is None:
sender = {'email': "noreply@%" % (settings.EXTERNAL_HOST,), 'name': 'Zulip'} # This may likely overridden by settings.DEFAULT_FROM_EMAIL
sender = {'email': settings.NOREPLY_EMAIL_ADDRESS, 'name': 'Zulip'}
for recipient in recipients: for recipient in recipients:
email_fields = {'email_html': email_html, email_fields = {'email_html': email_html,
'email_subject': subject, 'email_subject': subject,
@@ -2163,7 +2168,7 @@ def send_future_email(recipients, email_html, email_text, subject,
# Mandrill implementation # Mandrill implementation
if sender is None: if sender is None:
sender = {'email': 'noreply@zulip.com', 'name': 'Zulip'} sender = {'email': settings.NOREPLY_EMAIL_ADDRESS, 'name': 'Zulip'}
message = {'from_email': sender['email'], message = {'from_email': sender['email'],
'from_name': sender['name'], 'from_name': sender['name'],
@@ -2189,7 +2194,7 @@ def send_future_email(recipients, email_html, email_text, subject,
def send_local_email_template_with_delay(recipients, template_prefix, def send_local_email_template_with_delay(recipients, template_prefix,
template_payload, delay, template_payload, delay,
tags=[], sender={'email': 'noreply@zulip.com', 'name': 'Zulip'}): tags=[], sender={'email': settings.NOREPLY_EMAIL_ADDRESS, 'name': 'Zulip'}):
html_content = loader.render_to_string(template_prefix + ".html", template_payload) html_content = loader.render_to_string(template_prefix + ".html", template_payload)
text_content = loader.render_to_string(template_prefix + ".text", template_payload) text_content = loader.render_to_string(template_prefix + ".text", template_payload)
subject = loader.render_to_string(template_prefix + ".subject", template_payload).strip() subject = loader.render_to_string(template_prefix + ".subject", template_payload).strip()

View File

@@ -5,6 +5,7 @@ import datetime
from django.db.models import Q from django.db.models import Q
from django.template import loader from django.template import loader
from django.conf import settings
from zerver.lib.actions import build_message_list, hashchange_encode, \ from zerver.lib.actions import build_message_list, hashchange_encode, \
send_future_email send_future_email
@@ -84,7 +85,7 @@ def gather_new_streams(user_profile, threshold):
new_streams = list(Stream.objects.filter( new_streams = list(Stream.objects.filter(
realm=user_profile.realm, date_created__gt=threshold)) realm=user_profile.realm, date_created__gt=threshold))
base_url = "https://zulip.com/#narrow/stream/" base_url = "https://%s/#narrow/stream/" % (settings.EXTERNAL_HOST,)
streams_html = [] streams_html = []
streams_plain = [] streams_plain = []
@@ -117,7 +118,7 @@ def handle_digest_email(user_profile_id, cutoff):
message__pub_date__gt=cutoff).order_by("message__pub_date") message__pub_date__gt=cutoff).order_by("message__pub_date")
# Start building email template data. # Start building email template data.
template_payload = {'name': user_profile.full_name} template_payload = {'name': user_profile.full_name, 'external_host': settings.EXTERNAL_HOST}
# Gather recent missed PMs, re-using the missed PM email logic. # Gather recent missed PMs, re-using the missed PM email logic.
pms = all_messages.filter(~Q(message__recipient__type=Recipient.STREAM)) pms = all_messages.filter(~Q(message__recipient__type=Recipient.STREAM))
@@ -159,7 +160,7 @@ def handle_digest_email(user_profile_id, cutoff):
recipients = [{'email': user_profile.email, 'name': user_profile.full_name}] recipients = [{'email': user_profile.email, 'name': user_profile.full_name}]
subject = "While you've been gone: the Zulip Digest" subject = "While you've been gone: the Zulip Digest"
sender = {'email': 'support@zulip.com', 'name': 'Zulip Support'} sender = {'email': settings.NOREPLY_EMAIL_ADDRESS, 'name': 'Zulip Support'}
# We don't want to send emails containing almost no information. # We don't want to send emails containing almost no information.
if enough_traffic(template_payload["unread_pms"], if enough_traffic(template_payload["unread_pms"],

View File

@@ -134,10 +134,14 @@ class ConfirmationEmailWorker(QueueProcessingWorker):
link = Confirmation.objects.get_link_for_object(invitee) link = Confirmation.objects.get_link_for_object(invitee)
send_local_email_template_with_delay([{'email': data["email"], 'name': ""}], send_local_email_template_with_delay([{'email': data["email"], 'name': ""}],
"zerver/emails/invitation/invitation_reminder_email", "zerver/emails/invitation/invitation_reminder_email",
{'activate_url': link, 'referrer': referrer}, {'activate_url': link,
'referrer': referrer,
'enterprise': settings.ENTERPRISE,
'external_host': settings.EXTERNAL_HOST,
'support_email': settings.ZULIP_ADMINISTRATOR},
datetime.timedelta(days=2), datetime.timedelta(days=2),
tags=["invitation-reminders"], tags=["invitation-reminders"],
sender={'email': 'zulip@zulip.com', 'name': 'Zulip'}) sender={'email': settings.ZULIP_ADMINISTRATOR, 'name': 'Zulip'})
@assign_queue('user_activity') @assign_queue('user_activity')
class UserActivityWorker(QueueProcessingWorker): class UserActivityWorker(QueueProcessingWorker):