admin:dismemberment
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
admin:dismemberment [2023/02/19 15:34] – hibby | admin:dismemberment [2023/03/05 15:24] – [Example email] Wouter | ||
---|---|---|---|
Line 12: | Line 12: | ||
Articles don't specify a timeline for the steps but they do have to happen in that order (and it's good idea to leave a decent interval between reminder and actually dismembering folks so they can respond to the reminder). | Articles don't specify a timeline for the steps but they do have to happen in that order (and it's good idea to leave a decent interval between reminder and actually dismembering folks so they can respond to the reminder). | ||
- | ==== Example email ==== | + | ==== Example email, in Python 3==== |
- | Swap out dummy list of people to send to for the list from the hub page of folks behind on dues. | + | ''' |
- | < | + | username, real name, email address, |
- | #+BEGIN_SRC python | + | |
- | # -*- coding: utf-8 -*- | + | |
- | from email.MIMEText import MIMEText | + | yagmail is used in combination with gmail for smtp emailing. |
- | from localSettings import * | + | |
- | import smtplib | + | |
- | from jinja2 import Environment | + | |
- | email = """ | + | ''' |
- | Hello from 57North Hacklab, | + | |
- | Our records don't show any payments from you since {{ last_payment }}. That is long enough ago that you're on the list of people who can have their membership terminated by the board. We're planning to be going through that list at a board meeting {{ meeting }}. | + | # |
+ | import yagmail | ||
+ | import csv | ||
- | If you think there should be payment(s) more recently than that: please get in touch (57north-ctte-private@lists.57north.org.uk) with when and how you paid and we can look into why it didn't get recorded. | + | ##gmail username |
+ | sender = ' | ||
+ | ##gmail app password | ||
+ | password = ' | ||
- | We don't like terminating memberships so we haven' | + | ## reply to email |
+ | reply_email = '57north-ctte-private@57north.org.uk' | ||
- | If you don't want to keep up your membership please let us know at 57north-ctte-private@lists.57north.org.uk | ||
- | If you do want to continue being a member: please pay. Our preferred mechanism to receive money is via bank transfer | + | ##open csv file and loop through every line, sending emails one at a time. |
+ | with open(' | ||
+ | csv_reader = csv.reader(csv_file, delimiter=',') | ||
+ | | ||
- | If you're a bit behind we don't necessarily expect you to pay all of the back dues to avoid having your membership terminated - though if you want to we'll certainly appreciate the money. We are happy to consider you back in "good standing" | + | for row in csv_reader: |
+ | lastpayment = row[3] | ||
+ | username = row[0] | ||
+ | address = row[2] | ||
+ | contents = [ | ||
+ | | ||
+ | |||
+ | Dear """ | ||
- | Thanks, | + | Our records don't show any payments from you since """ |
- | The 57North Hacklab Ltd. board of directors. | + | |
- | Bank transfer details: | + | If you think there should be payment(s) more recently than that: please get in touch (57north-ctte-private@57north.org.uk) with when and how you paid and we can look into why it didn't get recorded. |
- | Account name: | + | |
- | Account number: | + | |
- | Sort code: | + | |
- | Payment reference: | + | |
- | Payment: | + | |
- | 57North Hacklab Ltd. is a company registered in Scotland (No. SC470230). | + | We don't like terminating memberships so, this has led to the member list having people on it that we know have moved away, and others that we haven' |
- | 57North and 57North Hacklab are trading names of 57North Hacklab Ltd. | + | |
- | """ | + | If you don't want to keep up your membership please let us know at 57north-ctte-private@57north.org.uk |
- | dummy = [{' | + | If you do want to continue being a member: please consider paying or if you are having temporary cashflow concerns, then please do let us know so we can work something out. Our preferred mechanism to receive money is via bank transfer (details in hackhub, or below) or you can give cash to a director. If you won't be able to do that before the Tuesday's open night meeting, but do intend to be back in the near future: get in touch (57north-ctte-private@57north.org.uk), we can possibly be a bit more flexible. |
- | def send(subject, | + | If you're a bit behind we don't necessarily expect you to pay all of the back dues to avoid having your membership terminated |
- | try: | + | |
- | message = MIMEText(message) | + | |
- | message['Subject'] = subject | + | |
- | message[' | + | |
- | message[' | + | |
- | message[' | + | |
- | + | ||
- | server = smtplib.SMTP(mailserver) | + | |
- | server.starttls() | + | |
- | server.login(user, | + | |
- | server.sendmail(addr, | + | |
- | message.as_string()) | + | |
- | server.close() | + | |
- | except Exception, ex: | + | |
- | print " | + | |
- | print ex | + | |
- | if __name__==" | + | Thanks, |
- | for person in dummy: | + | |
- | print " | + | |
- | send(" | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | #+END_SRC | + | |
- | </code> | + | The 57North Hacklab Ltd. board of directors. |
+ | |||
+ | Bank transfer details: | ||
+ | Account name: | ||
+ | Account number: | ||
+ | Sort code: 83-15-31 | ||
+ | Payment reference: | ||
+ | Payment: | ||
+ | |||
+ | 57North Hacklab Ltd. is a company registered in Scotland (No. SC470230). | ||
+ | 57North and 57North Hacklab are trading names of 57North Hacklab Ltd. | ||
+ | |||
+ | """ | ||
+ | ] | ||
+ | ## | ||
+ | yag = yagmail.SMTP(user=sender, | ||
+ | ##sending the email | ||
+ | yag.send(to=address, | ||
+ | | ||
===== Other Reasons ===== | ===== Other Reasons ===== |
admin/dismemberment.txt · Last modified: 2023/03/05 15:25 by Wouter