User Tools

Site Tools


admin:dismemberment

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
admin:dismemberment [2020/04/20 14:31] – created hibbyadmin:dismemberment [2023/03/05 15:25] (current) – [Example email, in Python 3] Wouter
Line 6: Line 6:
  
 Requirements: Requirements:
- - Member is more than 2 months behind on dues. +  - Member is more than 2 months behind on dues. 
- - Send reminder that they are behind on dues.  +  - Send reminder that they are behind on dues.  
- - Pass resolution at board meeting to dismember them.+  - Pass resolution at board meeting to dismember them.
  
 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. 
-<code> 
 #+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 board meeting {{ meeting }}. +'''This script sends out dismemberment emails, from csv file with 4 columns:  
 + username, real name, email address,last payment
  
-If you think there should be payment(s) more recently than that: please get in touch (57north-ctte-private@lists.57north.co) with when and how you paid and we can look into why it didn't get recorded+yagmail is used in combination with gmail for smtp emailing.
  
-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), we can possibly be a bit more flexible.+##gmail username 
 +sender = 'youremailaddress' 
 +##gmail app password  
 +password = 'yourpassword'
  
-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 moneyWe are happy to consider you back in "good standing" if you pay for this month and last.+## 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:           57North Hacklab Ltd. +with open('dismemberment.csv') as csv_file
-Account number:         11 088 091 +    csv_reader = csv.reader(csv_file, delimiter=',') 
-Sort code:         83-15-31 +        
-Payment reference: {{ username }} +
-Payment:                GBP 20.00 monthly on/soon after the 1st of every month+
  
-57North Hacklab Ltd. is a company registered in Scotland (No. SC470230). +    for row in csv_reader: 
-57North and 57North Hacklab are trading names of 57North Hacklab Ltd.+        lastpayment = row[3] 
 +        username = row[0] 
 +        address = row[2] 
 +        contents = [ 
 +    """ Hello from 57North Hacklab. 
 +     
 +    Dear """ + username + """,
  
-"""+    Our records don't show any payments from you since """ + lastpayment+ """. 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 on 5th April 2023.
  
-dummy = [{'username':'someone', 'email':'someone@example.com', 'last_payment':'None'}]+    If you think there should be payment(s) more recently than thatplease 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(subjectmessagerecipient): +    We don't like terminating memberships sothis has led to the member list having people on it that we know have moved awayand others that we haven't seen for quite a whileIt really is time we cleaned this up.
-    try: +
-        message = MIMEText(message) +
-        message['Subject'] = subject +
-        message['From'] = addr +
-        message['To'] = recipient +
-        message['Reply-To'] = '57north-ctte-private@lists.57north.co' +
-         +
-        server = smtplib.SMTP(mailserver) +
-        server.starttls() +
-        server.login(user, passwd) +
-        server.sendmail(addr, [recipient, bcc, "57north-ctte-private@lists.57north.co"], +
-                        message.as_string()) +
-        server.close() +
-    except Exception, ex: +
-        print "Failed to send email.+
-        print ex+
  
-if __name__=="__main__": +    If you don't want to keep up your membership please let us know at 57north-ctte-private@57north.org.uk
-    for person in dummy: +
-        print "Emailing ", person['username'+
-        send("57North membership", +
-             Environment().from_string(email).render( +
-                 last_payment=person['last_payment'], username=person['username'], +
-                 meeting="19:30 Thursday 16th March 2017"), +
-             person['email']) +
-#+END_SRC+
  
-</code>+    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.
  
 +    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" if you pay for this month and last.
 +
 +    Thanks,
 +
 +    The 57North Hacklab Ltd. board of directors.
 +
 +    Bank transfer details:
 +    Account name:           57North Hacklab Ltd.
 +    Account number:         11 088 091
 +    Sort code:         83-15-31
 +    Payment reference: """ + username + """
 +    Payment:                GBP 20.00 monthly on/soon after the 1st of every month
 +
 +    57North Hacklab Ltd. is a company registered in Scotland (No. SC470230).
 +    57North and 57North Hacklab are trading names of 57North Hacklab Ltd.
 +
 +    """
 +]
 +        ##initializing the server connection
 +        yag = yagmail.SMTP(user=sender, password=password)
 +        ##sending the email
 +        yag.send(to=address,subject='Hello from 57North Hacklab',bcc='57north-ctte-private@57north.org.uk', contents =contents, headers={"Reply-To":f"{reply_email}"})
 +        
 +#+END_SRC
 ===== Other Reasons ===== ===== Other Reasons =====
  
admin/dismemberment.1587393094.txt.gz · Last modified: 2020/07/07 20:48 (external edit)