A webapp/form for people to join pEp coop. Fork of Cultural Commons Collecting Society (C3S) SCE
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

invite_members_texts.py 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # -*- coding: utf-8 -*-
  2. """
  3. Email creation for invitation to barcamp and general assembly.
  4. """
  5. from c3smembership.mail_utils import (
  6. get_template_text,
  7. get_email_footer,
  8. get_salutation,
  9. )
  10. DEBUG = False
  11. def make_bcga18_invitation_email(member, url):
  12. """
  13. Create email subject and body for an invitation email for members.
  14. Returns:
  15. Tuple: message subject and body in users language.
  16. """
  17. if DEBUG: # pragma: no cover
  18. print(u"the member: {}".format(member))
  19. print(u"the member.locale: {}".format(member.locale))
  20. print(u"the url: {}".format(url))
  21. print(u"the subject: {}".format(
  22. get_template_text('bcga2018_invite_subject', member.locale)))
  23. print(u"the salutation: {}".format(get_salutation(member)))
  24. print(u"the footer: {}".format(get_email_footer(member.locale)))
  25. print(u"the body: {}".format(
  26. get_template_text('bcga2018_invite_body', member.locale).format(
  27. salutation=get_salutation(member),
  28. invitation_url=url,
  29. footer=get_email_footer(member.locale))))
  30. return (
  31. get_template_text('bcga2018_invite_subject', member.locale).rstrip(
  32. '\n'), # remove newline (\n) from mail subject
  33. get_template_text('bcga2018_invite_body', member.locale).format(
  34. salutation=get_salutation(member),
  35. invitation_url=url,
  36. footer=get_email_footer(member.locale)
  37. )
  38. )