Compare commits

..

5 Commits

Author SHA1 Message Date
abnercoimbre
f5b20a71de README: Include link to issue #2 2023-09-25 10:52:08 -07:00
abnercoimbre
a902f5a685 Prettify mailing list dump. 2023-09-25 10:46:22 -07:00
abnercoimbre
153ba885c8 Update README 2023-09-22 11:46:19 -07:00
abnercoimbre
4ff791d9fe Update README 2023-09-22 11:41:07 -07:00
abnercoimbre
2df6e67ffb Update README 2023-09-22 11:37:02 -07:00
2 changed files with 17 additions and 13 deletions

View File

@@ -1,24 +1,22 @@
------
**DISCLAIMER: This project is very much a Work In Progress. It is for meetup hosts pioneering Handmade Meetups. Hosts are expected to be programmers who are comfortable running and editing command-line programs.**
**DISCLAIMER: This project is very much a Work In Progress. It is for meetup hosts pioneering Handmade Meetups. Hosts are expected to be programmers comfortable with command-line programs. You can get help or give feedback in the [`#meetups`](https://discord.com/channels/239737791225790464/424523844016144394) channel of the [Handmade Network Discord](https://discord.gg/hmn).**
------
`send_mail.py` lets you email a [meetup group](https://handmadecities.com/meetups) using Handmade Cities branding. You can get help or give feedback in the [`#meetups`](https://discord.com/channels/239737791225790464/424523844016144394) channel of the [Handmade Network Discord](https://discord.gg/hmn).
# send_mail
The `send_mail` script is for Handmade meetup hosts. You can email a meetup invite to your group like so:
`send_mail` lets you email a [meetup group](https://handmadecities.com/meetups) using Handmade Cities branding. You can send an invite to your meetup group like so:
> python3 send_mail.py --subject SUBJECT --body BODY
`> python3 send_mail.py --subject SUBJECT --body BODY`
where SUBJECT is the subject of your email and BODY is the file containing its contents. Plain text or HTML is supported. Your email will automatically include the Handmade Cities branding along with unsubscribe links!
where `SUBJECT` is the subject of your email and `BODY` is the file containing its contents. Plain text or HTML is supported. Your email will automatically include the Handmade Cities brand along with unsubscribe links!
Note that you can dump the mailing list of your meetup group so far:
> python3 send_mail.py --dump
`> python3 send_mail.py --dump`
This list grows automatically as more people sign up for your city (at handmadecities.com/meetups)
This list grows automatically as more people sign up for your city.
## app.ini
`send_mail` requires a companion `app.ini` file. It has the requisite secret credentials to be able to dump the mailing list and otherwise send the actual emails.
`send_mail` requires a companion `app.ini` file. It has the secret credentials to be able to dump the mailing list and otherwise send real emails.
Below is how the file looks like. Anything secret is censored as `xxx`:
Below is how the file might look like. (Secret stuff is censored as `xxx`):
```
; User Constants - Update as needed
@@ -42,4 +40,6 @@ SENDER_EMAIL = abner@handmadecities.com
MESSAGE_STREAM = xxx
```
LIVE is false by default, in which case the script only sends an email to whichever address is in TEST_EMAIL. Set it to true once you're ready to mass-email your entire meetup group.
`LIVE` is false by default, in which case the script only sends an email to `TEST_EMAIL`. Set `LIVE` to true when you're ready to mass-email your group.
## Known Issues
`send_mail` uses the `requests` module which may or may not be in your system. You'll need to use `pip` if it's not. See [this issue](https://git.handmadecities.com/meetups/send-mail/issues/2) for details.

View File

@@ -137,8 +137,12 @@ if __name__ == '__main__':
if args.dump:
meetup_group = dump_emails()
for email in meetup_group:
print(email)
print(f"Handmade Meetups - \033[1m{HMC_CITY}\033[0m\n")
max_index_width = len(str(len(meetup_group)))
for index, email in enumerate(meetup_group, start=1):
index_str = str(index).rjust(max_index_width) # Right-align the index
print(f"{index_str}. \033[1m{email}\033[0m")
print("\nMailing list grows automatically as more subscribe at \033[1mhandmadecities.com/meetups\033[0m")
elif args.subject and args.body:
subject = args.subject
body = ''