Hi,
Wanna send multi-line email using ArcGIS python API.
import arcgis
gis = arcgis.gis.GIS("home")
all_users = arcgis.gis.UserManager(gis)
me = gis.users.me
msg = " a line \n a new line"
print(msg)
all_users.send_notification([me], subject='test new line', message=msg, type='email', client_id=None)
But email arrives as one line.
Try the {sep} and formatting it like below:
msg = (
f"From: {fromaddr}{sep}"
f"To: {toaddr}{sep}"
f"Subject: New complaint - {requestType}"
f"{sep}"
f"A new complaint has been made: {sep}"
f"Type of Problem: {requestType}{sep}"
f"Name: {contact}{sep}"
f"Date Submitted: {datetime.datetime.fromtimestamp(int(submittedOn)//1000)}{sep}"
f"Details: {details}{sep}"
)
Thank you very much for your answer. I have tested with different separators as sep without any success.
What email client are you using? I've seen Outlook attempt to remove what it thinks are extra line breaks, causing some content to appear as a single line.