From e364e31e25bd1d4b8d801c845a96d6be708f0a18 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 19 Jan 2023 09:27:16 +0100 Subject: Implement signup approval in server --- server/lib/emails/common/base.pug | 12 +--------- .../user-registration-request-accepted/html.pug | 10 +++++++++ .../user-registration-request-rejected/html.pug | 9 ++++++++ .../lib/emails/user-registration-request/html.pug | 9 ++++++++ server/lib/emails/verify-email/html.pug | 26 ++++++++++++---------- 5 files changed, 43 insertions(+), 23 deletions(-) create mode 100644 server/lib/emails/user-registration-request-accepted/html.pug create mode 100644 server/lib/emails/user-registration-request-rejected/html.pug create mode 100644 server/lib/emails/user-registration-request/html.pug (limited to 'server/lib/emails') diff --git a/server/lib/emails/common/base.pug b/server/lib/emails/common/base.pug index 6da5648e4..41e94564d 100644 --- a/server/lib/emails/common/base.pug +++ b/server/lib/emails/common/base.pug @@ -222,19 +222,9 @@ body(width="100%" style="margin: 0; padding: 0 !important; mso-line-height-rule: td(aria-hidden='true' height='20' style='font-size: 0px; line-height: 0px;') br //- Clear Spacer : END - //- 1 Column Text : BEGIN - if username - tr - td(style='background-color: #cccccc;') - table(role='presentation' cellspacing='0' cellpadding='0' border='0' width='100%') - tr - td(style='padding: 20px; font-family: sans-serif; font-size: 15px; line-height: 20px; color: #555555;') - p(style='margin: 0;') - | You are receiving this email as part of your notification settings on #{instanceName} for your account #{username}. - //- 1 Column Text : END //- Email Body : END //- Email Footer : BEGIN - unless hideNotificationPreferences + unless hideNotificationPreferencesLink table(align='center' role='presentation' cellspacing='0' cellpadding='0' border='0' width='100%' style='margin: auto;') tr td(style='padding: 20px; padding-bottom: 0px; font-family: sans-serif; font-size: 12px; line-height: 15px; text-align: center; color: #888888;') diff --git a/server/lib/emails/user-registration-request-accepted/html.pug b/server/lib/emails/user-registration-request-accepted/html.pug new file mode 100644 index 000000000..7a52c3fe1 --- /dev/null +++ b/server/lib/emails/user-registration-request-accepted/html.pug @@ -0,0 +1,10 @@ +extends ../common/greetings + +block title + | Congratulation #{username}, your registration request has been accepted! + +block content + p Your registration request has been accepted. + p Moderators sent you the following message: + blockquote(style='white-space: pre-wrap') #{moderationResponse} + p Your account has been created and you can login on #[a(href=loginLink) #{loginLink}] diff --git a/server/lib/emails/user-registration-request-rejected/html.pug b/server/lib/emails/user-registration-request-rejected/html.pug new file mode 100644 index 000000000..ec0aa8dfe --- /dev/null +++ b/server/lib/emails/user-registration-request-rejected/html.pug @@ -0,0 +1,9 @@ +extends ../common/greetings + +block title + | Registration request of your account #{username} has rejected + +block content + p Your registration request has been rejected. + p Moderators sent you the following message: + blockquote(style='white-space: pre-wrap') #{moderationResponse} diff --git a/server/lib/emails/user-registration-request/html.pug b/server/lib/emails/user-registration-request/html.pug new file mode 100644 index 000000000..64898f3f2 --- /dev/null +++ b/server/lib/emails/user-registration-request/html.pug @@ -0,0 +1,9 @@ +extends ../common/greetings + +block title + | A new user wants to register + +block content + p User #{registration.username} wants to register on your PeerTube instance with the following reason: + blockquote(style='white-space: pre-wrap') #{registration.registrationReason} + p You can accept or reject the registration request in the #[a(href=`${WEBSERVER.URL}/admin/moderation/registrations/list`) administration]. diff --git a/server/lib/emails/verify-email/html.pug b/server/lib/emails/verify-email/html.pug index be9dde21b..19ef65f75 100644 --- a/server/lib/emails/verify-email/html.pug +++ b/server/lib/emails/verify-email/html.pug @@ -1,17 +1,19 @@ extends ../common/greetings block title - | Account verification + | Email verification block content - p Welcome to #{instanceName}! - p. - You just created an account at #[a(href=WEBSERVER.URL) #{instanceName}]. - Your username there is: #{username}. - p. - To start using your account you must verify your email first! - Please follow #[a(href=verifyEmailUrl) this link] to verify this email belongs to you. - p. - If you can't see the verification link above you can use the following link #[a(href=verifyEmailUrl) #{verifyEmailUrl}] - p. - If you are not the person who initiated this request, please ignore this email. + if isRegistrationRequest + p You just requested an account on #[a(href=WEBSERVER.URL) #{instanceName}]. + else + p You just created an account on #[a(href=WEBSERVER.URL) #{instanceName}]. + + if isRegistrationRequest + p To complete your registration request you must verify your email first! + else + p To start using your account you must verify your email first! + + p Please follow #[a(href=verifyEmailUrl) this link] to verify this email belongs to you. + p If you can't see the verification link above you can use the following link #[a(href=verifyEmailUrl) #{verifyEmailUrl}] + p If you are not the person who initiated this request, please ignore this email. -- cgit v1.2.3