#πŸ”’ Email Automation

33 messages Β· Page 1 of 1 (latest)

minor zephyr
#

Hello i am making an email automation program using smtplib and like i want some suggestions for customised body and subject for each recipient mail.
Any suggestions and any guidance

tall marshBOT
#

@minor zephyr

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

dire zenith
#

You want ideas for what to put in the email?

#

Or ideas about how to make a custom email?

minor zephyr
#

Like a common subject and body mail is being sent through my program currently to all the recipient mail list

#

Like i sent a mail regarding like testing mail and same message to all

#

like how to send custom for each recipient

#

Like in conferences they send custom mails so how do they do so\

dire zenith
#

You could do something like:

recipient = 'fred'
subject = f'Hello {recipient}'
minor zephyr
#

Look i would need to read a csv for this right ??

dire zenith
#

Sonds good.

minor zephyr
#

Look lets say we are doing automation for a conference so like i want to make a universal automater like the user enters the subject general one as like
Hello {name} we accept your paper titled {title} and i input this

#

ok now my general automater reads braces

#

{}

#

so it will replace the text in braces for each recipient my matching in csv and inserting

dire zenith
#

Well strings have a .format_map() method which understands braces.

#

!doc str.format_map

tall marshBOT
#

str.format_map(mapping, /)```
Similar to `str.format(**mapping)`, except that `mapping` is used directly and not copied to a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict). This is useful if for example `mapping` is a dict subclass...
minor zephyr
#

\Noice

#

are you with me

#

give me some secs i will modify and tell you the result

#

Man but we need to read two csvs maybe or one only cause we have body and subject

dire zenith
#

A CSV can have multiple columns. Dunno if that helps you.

minor zephyr
#

one sec

#

how to use str.format_map

#

wait got it

minor zephyr
#

Hello

#

Worked

#

well done

#

Man i could read csv as rows

#

so this works great lemme do some stuff

tall marshBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.