Skip to content

Commit

Permalink
Fix spaces being inserted by office365 by specifying encoding for MIM…
Browse files Browse the repository at this point in the history
…EText
  • Loading branch information
RachelDuffin committed Jul 9, 2024
1 parent 4fd486c commit a52209d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ad_email/ad_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def send_email(
self.msg["Subject"] = email_subject
self.msg["From"] = self.sender
self.msg["To"] = recipients
self.msg.attach(MIMEText(email_message, "html")) # Add msg to e-mail body
self.msg.attach(MIMEText(email_message, "html", "utf-8")) # Add msg to e-mail body
self.logger.info(self.logger.log_msgs["sending_email"], self.msg)
# Configure SMTP server connection for sending email
with smtplib.SMTP(
Expand Down
21 changes: 13 additions & 8 deletions ad_email/templates/email.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,27 @@
<body>
<div class="content">
{% if test_mode == True -%}
<p><b>AUTOMATED SCRIPTS ARE BEING RUN IN TEST MODE. PLEASE IGNORE THIS EMAIL</b></p>
<span><b>AUTOMATED SCRIPTS ARE BEING RUN IN TEST MODE. PLEASE IGNORE THIS EMAIL</b></span><br>
<br>
{% endif %}
<p>{{ runfolder_name }} being processed using workflow(s) {{ workflows }}</p>
<span>{{ runfolder_name }} being processed using workflow(s) {{ workflows }}</span><br>
<br>
{% if queries %}
<p>Please update Moka using the below queries and ensure that {{ sample_count }} records are updated:</p>
<p> {{ queries|safe }}</p>
<span>Please update Moka using the below queries and ensure that {{ sample_count }} records are updated:</span><br>
<br>
<span> {{ queries|safe }}</span><br>
{% else %}
<p>{{ sample_count }} samples are being processed:</p>
<span>{{ sample_count }} samples are being processed:</span><br>
{% endif %}
<br>
{% if samples %}
<p> {{ samples|safe }} </p>
<span> {{ samples|safe }} </span><br>
{% endif %}
<br>
<div class="footer">
<span class="apple-link">Generated by automate_demultiplex/{{ git_tag }}</span>
<span class="apple-link">Generated by automate_demultiplex/{{ git_tag }}</span><br>
<br>
<span>Maintained by: Bioinformatics Team, Synnovis, GSTT</span>
<span>Maintained by: Bioinformatics Team, Synnovis, GSTT</span><br>
</div>
</body>

Expand Down

0 comments on commit a52209d

Please sign in to comment.