emails: Add new onboarding email with guide for organization type.

Adds a new welcome email, `onboarding_zulip_guide`, to be sent four
days after a new user registers with a Zulip organization if the
organization has specified a particular organization type that has
a guide in the corporate `/for/.../` pages. If there is no guide,
then no email is scheduled or sent.

The current `for/communities/` page is not very useful for users
who are not organization administrators, so these onboarding guide
emails are further restricted for those organization types to
only go to new users who are invited/registered as admins for the
organzation.

Adds two database queries for new user registrations: one to get
the organization's type and one to create the scheduled email.

Adds two email logs because the email is sent both to a new user
who registers with an existing organization and to the organization
owner when they register a new organization.

Co-authored by: Alya Abbott <alya@zulip.com>
This commit is contained in:
Lauryn Menard
2023-03-15 20:18:09 +01:00
committed by Tim Abbott
parent ab00648e3e
commit f391bfeec6
10 changed files with 423 additions and 60 deletions

View File

@@ -409,7 +409,7 @@ class TestDevelopmentEmailsLog(ZulipTestCase):
"INFO:root:Emails sent in development are available at http://testserver/emails"
)
# logger.output is a list of all the log messages captured. Verify it is as expected.
self.assertEqual(logger.output, [output_log] * 15)
self.assertEqual(logger.output, [output_log] * 17)
# Now, lets actually go the URL the above call redirects to, i.e., /emails/
result = self.client_get(result["Location"])