Skip to content

Instantly share code, notes, and snippets.

@redgeoff
Last active March 2, 2022 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redgeoff/73930fbcddef0e6b4627298dcf47d7d4 to your computer and use it in GitHub Desktop.
Save redgeoff/73930fbcddef0e6b4627298dcf47d7d4 to your computer and use it in GitHub Desktop.
Grocery Shopping Bot: Send Email
*** Settings ***
Documentation Send Email
Library DateTime
Library Email.py
*** Keywords ***
Send Email
[Arguments] ${smtp_username} ${smtp_password} ${smtp_server} ${smtp_port} ${email_recipient} ${items_in_cart}
${date}= Get Current Date UTC exclude_millis=yes
${converted_date}= Convert Date ${date} result_format=%a %B %d %H:%M:%S UTC %Y
Set Local Variable ${i} 1
Set Local Variable ${body} <table border="1"><tr><th>#</th><th>Todoist Item</th><th>Name in Safeway Cart</th></tr>
FOR ${item} IN @{items_in_cart}
${body}= Catenate ${body} <tr><td>${i}</td><td>${item.name}</td><td>${item.name_in_store}</td></tr>
${i} Evaluate ${i}+1
END
${body}= Catenate ${body} </table>
Send Html Email ${smtp_username} ${smtp_password} ${smtp_server} ${smtp_port} ${email_recipient} Grocery shopping bot ${converted_date} ${body}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment