admin:dismemberment
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
admin:dismemberment [2020/04/20 14:32] – hibby | admin:dismemberment [2023/03/05 15:25] (current) – [Example email, in Python 3] 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 ==== | ||
- | |||
- | Swap out dummy list of people to send to for the list from the hub page of folks behind on dues. | ||
- | < | ||
#+BEGIN_SRC python | #+BEGIN_SRC python | ||
# -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||
- | from email.MIMEText import MIMEText | ||
- | 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 }}. | + | ''' |
+ | | ||
- | If you think there should be payment(s) more recently than that: please get in touch (57north-ctte-private@lists.57north.co) | + | yagmail is used in combination |
- | We don't like terminating memberships so we haven't since September 2014, this has led to the member list having people on it that we know have moved away, and others that we haven't seen for quite a while. It really is time we cleaned this up. | + | ''' |
- | If you don't want to keep up your membership please let us know at 57north-ctte-private@lists.57north.co | + | #importing the Yagmail library |
+ | import yagmail | ||
+ | import csv | ||
- | If you do want to continue being a member: please pay. Our preferred mechanism to receive money is via bank transfer (details in hub, or below) or you can give cash to a director. If you won't be able to do that before the meeting, but do intend to be back in the near future: get in touch (57north-ctte-private@lists.57north.co), | + | ##gmail username |
+ | sender = ' | ||
+ | ##gmail app password | ||
+ | password = ' | ||
- | 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 | + | ## reply to email |
+ | reply_email = '57north-ctte-private@57north.org.uk' | ||
- | Thanks, | ||
- | The 57North Hacklab Ltd. board of directors. | ||
- | Bank transfer details: | + | ##open csv file and loop through every line, sending emails one at a time. |
- | Account name: | + | with open(' |
- | Account number: 11 088 091 | + | |
- | Sort code: | + | |
- | Payment reference: | + | |
- | Payment: | + | |
- | 57North Hacklab Ltd. is a company registered | + | for row in csv_reader: |
- | 57North and 57North Hacklab are trading names of 57North Hacklab | + | |
+ | username = row[0] | ||
+ | address = row[2] | ||
+ | contents = [ | ||
+ | """ | ||
+ | |||
+ | Dear """ | ||
- | """ | + | Our records don't show any payments from you since """ |
- | dummy = [{' | + | 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. |
- | def send(subject, message, recipient): | + | 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't seen for quite a while. It really is time we cleaned this up. |
- | try: | + | |
- | message = MIMEText(message) | + | |
- | message['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__==" | + | If you don't want to keep up your membership |
- | for person in dummy: | + | |
- | print " | + | |
- | send(" | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | #+END_SRC | + | |
- | </ | + | 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' |
+ | 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" | ||
+ | |||
+ | Thanks, | ||
+ | |||
+ | The 57North Hacklab Ltd. board of directors. | ||
+ | |||
+ | Bank transfer details: | ||
+ | Account name: | ||
+ | Account number: | ||
+ | Sort code: | ||
+ | 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, | ||
+ | | ||
+ | #+END_SRC | ||
===== Other Reasons ===== | ===== Other Reasons ===== | ||
admin/dismemberment.1587393128.txt.gz · Last modified: 2020/07/07 20:48 (external edit)