Show More
@@ -49,6 +49,14 b' def send_email(recipients, subject, body' | |||
|
49 | 49 | log = get_logger(send_email) |
|
50 | 50 | |
|
51 | 51 | email_config = email_config or rhodecode.CONFIG |
|
52 | ||
|
53 | mail_server = email_config.get('smtp_server') or None | |
|
54 | if mail_server is None: | |
|
55 | log.error("SMTP server information missing. Sending email failed. " | |
|
56 | "Make sure that `smtp_server` variable is configured " | |
|
57 | "inside the .ini file") | |
|
58 | return False | |
|
59 | ||
|
52 | 60 | subject = "%s %s" % (email_config.get('email_prefix', ''), subject) |
|
53 | 61 | if not recipients: |
|
54 | 62 | # if recipients are not defined we send to email_config + all admins |
@@ -62,13 +70,6 b' def send_email(recipients, subject, body' | |||
|
62 | 70 | recipients += [config_email] |
|
63 | 71 | recipients += admins |
|
64 | 72 | |
|
65 | mail_server = email_config.get('smtp_server') or None | |
|
66 | if mail_server is None: | |
|
67 | log.error("SMTP server information missing. Sending email failed. " | |
|
68 | "Make sure that `smtp_server` variable is configured " | |
|
69 | "inside the .ini file") | |
|
70 | return False | |
|
71 | ||
|
72 | 73 | mail_from = email_config.get('app_email_from', 'RhodeCode') |
|
73 | 74 | user = email_config.get('smtp_username') |
|
74 | 75 | passwd = email_config.get('smtp_password') |
General Comments 0
You need to be logged in to leave comments.
Login now