mirror of
https://github.com/getredash/redash.git
synced 2025-12-25 01:03:20 -05:00
Show warning if email server isn't configured
This commit is contained in:
@@ -107,6 +107,17 @@
|
||||
}
|
||||
}]);
|
||||
|
||||
directives.directive('emailSettingsWarning', function() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
template: '<p class="alert alert-warning" ng-if="showMailWarning">It looks like your mail server isn\'t configured, make sure to configure it for the {{function}} to work.</p>',
|
||||
link: function(scope, elements, attrs) {
|
||||
scope.showMailWarning = clientConfig.mailSettingsMissing && currentUser.isAdmin;
|
||||
scope.function = attrs.function;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
directives.directive('rdTabs', ['$location', function ($location) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<div class="container">
|
||||
<email-settings-warning function="alert emails"></email-settings-warning>
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="alerts">Alerts</a></li>
|
||||
<li class="active">{{alert.name || getDefaultName() || "New"}}</li>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<div class="container">
|
||||
<email-settings-warning function="invite emails"></email-settings-warning>
|
||||
<users-nav></users-nav>
|
||||
|
||||
<form class="form" name="userForm" ng-submit="saveUser()" novalidate>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<div class="container">
|
||||
<email-settings-warning function="invite emails"></email-settings-warning>
|
||||
|
||||
<users-nav></users-nav>
|
||||
|
||||
<h2>{{user.name}}</h2>
|
||||
|
||||
@@ -44,20 +44,6 @@ def send_invite_email(inviter, invited, invite_url, org):
|
||||
send_mail.delay([invited.email], subject, html_content, text_content)
|
||||
|
||||
|
||||
def send_reminder_email(email):
|
||||
users = list(User.find_by_email(email))
|
||||
|
||||
if users:
|
||||
context = dict(users=users, email=email)
|
||||
html_content = render_template('emails/reminder.html', **context)
|
||||
text_content = render_template('emails/reminder.txt', **context)
|
||||
subject = u"Your Re:dash Account Reminder"
|
||||
|
||||
send_mail.delay([email], subject, html_content, text_content)
|
||||
else:
|
||||
logger.error("Reminder email - failed to find users for: %s", email)
|
||||
|
||||
|
||||
def send_password_reset_email(user):
|
||||
reset_link = reset_link_for_user(user)
|
||||
context = dict(user=user, reset_link=reset_link)
|
||||
|
||||
@@ -174,4 +174,5 @@ COMMON_CLIENT_CONFIG = {
|
||||
'dateFormat': DATE_FORMAT,
|
||||
'dateTimeFormat': "{0} HH:mm".format(DATE_FORMAT),
|
||||
'allowAllToEditQueries': FEATURE_ALLOW_ALL_TO_EDIT_QUERIES,
|
||||
'mailSettingsMissing': MAIL_DEFAULT_SENDER is None
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
{% extends "emails/layout.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<p class="intercom-align-left" style="line-height: 1.5; margin: 0 0 17px; text-align: left !important" align="left">Hi there,</p>
|
||||
<p class="intercom-align-left" style="line-height: 1.5; margin: 0 0 17px; text-align: left !important" align="left">
|
||||
We searched for Re:dash accounts you've already joined or are allowed to join, using {{email}} and we found the following:
|
||||
</p>
|
||||
<p class="intercom-align-left" style="line-height: 1.5; margin: 0 0 17px; text-align: left !important" align="left">
|
||||
<ul>
|
||||
{% for account in users %}
|
||||
<li>{{account.org.name}}: <a href="{{ url_for('redash.index', org_slug=account.org.slug, _external=True) }}">{{ url_for('redash.index', org_slug=account.org.slug, _external=True) }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
</p>
|
||||
<p class="intercom-align-left" style="line-height: 1.5; margin: 0 0 17px; text-align: left !important" align="left">
|
||||
If you're trying to join a specific account that isn't listed here, you can try contacting your account administrator for an invitation.
|
||||
You can also try a different email, or forge ahead and <a href="{{ url_for('redash.signup', _external=True)}}">create a new account</a>!
|
||||
</p>
|
||||
<p class="intercom-align-left" style="line-height: 1.5; margin: 0 0 17px; text-align: left !important" align="left">
|
||||
Please let us know if you have any other questions or feedback.
|
||||
</p>
|
||||
<p class="intercom-align-left" style="line-height: 1.5; margin: 0 0 17px; text-align: left !important" align="left">
|
||||
Cheers,<br/>
|
||||
Re:dash
|
||||
</p>
|
||||
{% endblock %}
|
||||
@@ -1,17 +0,0 @@
|
||||
Hi there,
|
||||
|
||||
We searched for Re:dash accounts you've already joined or are allowed to join, using {{email}} and we found the following:
|
||||
|
||||
{% for account in users %}
|
||||
* {{account.org.name}}: {{ url_for('redash.index', org_slug=account.org.slug, _external=True) }}
|
||||
{% endfor %}
|
||||
|
||||
If you're trying to join a specific account that isn't listed here, you can try contacting your team administrator for an invitation.
|
||||
You can also try a different email, or forge ahead and create a new team!
|
||||
|
||||
Please let us know if you have any other questions or feedback.
|
||||
|
||||
Cheers,
|
||||
|
||||
Re:dash
|
||||
|
||||
Reference in New Issue
Block a user