Email cleanup: Add RegisterNewEmailHtml.soy
Currently, we support sending emails with HTML format for all emails, except RegisterNewEmail. This change makes it allowed for all emails. As a follow-up change, we will be able to remove supportsHtml() since at that point it will always return true. Change-Id: Ic1d71d2602b7888088b9d6057e2ed8545f35848f
This commit is contained in:
@@ -109,10 +109,10 @@ actions made by the user in the Web UI such as cherry picking a commit or
|
|||||||
reverting a change. It is a `ChangeEmail`: see `ChangeSubject.soy` and
|
reverting a change. It is a `ChangeEmail`: see `ChangeSubject.soy` and
|
||||||
ChangeFooter.
|
ChangeFooter.
|
||||||
|
|
||||||
=== RegisterNewEmail.soy
|
=== RegisterNewEmail.soy and RegisterNewEmailHtml.soy
|
||||||
|
|
||||||
The `RegisterNewEmail.soy` template will determine the contents of the email
|
Those templates will determine the contents of the email related to registering
|
||||||
related to registering new email accounts.
|
new email accounts.
|
||||||
|
|
||||||
=== ReplacePatchSet.soy and ReplacePatchSetHtml.soy
|
=== ReplacePatchSet.soy and ReplacePatchSetHtml.soy
|
||||||
|
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ public class SitePathInitializer {
|
|||||||
extractMailExample("NewChange.soy");
|
extractMailExample("NewChange.soy");
|
||||||
extractMailExample("NewChangeHtml.soy");
|
extractMailExample("NewChangeHtml.soy");
|
||||||
extractMailExample("RegisterNewEmail.soy");
|
extractMailExample("RegisterNewEmail.soy");
|
||||||
|
extractMailExample("RegisterNewEmailHtml.soy");
|
||||||
extractMailExample("ReplacePatchSet.soy");
|
extractMailExample("ReplacePatchSet.soy");
|
||||||
extractMailExample("ReplacePatchSetHtml.soy");
|
extractMailExample("ReplacePatchSetHtml.soy");
|
||||||
extractMailExample("Restored.soy");
|
extractMailExample("Restored.soy");
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ public class MailSoySauceProvider implements Provider<SoySauce> {
|
|||||||
"NoReplyFooterHtml.soy",
|
"NoReplyFooterHtml.soy",
|
||||||
"Private.soy",
|
"Private.soy",
|
||||||
"RegisterNewEmail.soy",
|
"RegisterNewEmail.soy",
|
||||||
|
"RegisterNewEmailHtml.soy",
|
||||||
"ReplacePatchSet.soy",
|
"ReplacePatchSet.soy",
|
||||||
"ReplacePatchSetHtml.soy",
|
"ReplacePatchSetHtml.soy",
|
||||||
"Restored.soy",
|
"Restored.soy",
|
||||||
|
|||||||
@@ -60,6 +60,9 @@ public class RegisterNewEmailSender extends OutgoingEmail {
|
|||||||
@Override
|
@Override
|
||||||
protected void format() throws EmailException {
|
protected void format() throws EmailException {
|
||||||
appendText(textTemplate("RegisterNewEmail"));
|
appendText(textTemplate("RegisterNewEmail"));
|
||||||
|
if (useHtml()) {
|
||||||
|
appendHtml(soyHtmlTemplate("RegisterNewEmailHtml"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAllowed() {
|
public boolean isAllowed() {
|
||||||
@@ -79,4 +82,9 @@ public class RegisterNewEmailSender extends OutgoingEmail {
|
|||||||
}
|
}
|
||||||
return emailToken;
|
return emailToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean supportsHtml() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (C) 2020 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
{namespace com.google.gerrit.server.mail.template}
|
||||||
|
|
||||||
|
{template .RegisterNewEmailHtml}
|
||||||
|
{@param email: ?}
|
||||||
|
<p>
|
||||||
|
Welcome to Gerrit Code Review at {$email.gerritHost}.
|
||||||
|
To add a verified email address to your user account, please
|
||||||
|
click on the following link
|
||||||
|
</p>
|
||||||
|
{if $email.userNameEmail}
|
||||||
|
<p>
|
||||||
|
{sp}while signed in as {$email.userNameEmail}
|
||||||
|
</p>
|
||||||
|
{/if}:
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
{$email.gerritUrl}#/VE/{$email.emailRegistrationToken}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
If you have received this mail in error, you do not need to take any
|
||||||
|
action to cancel the account. The address will not be activated, and
|
||||||
|
you will not receive any further emails.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
If clicking the link above does not work, copy and paste the URL in a
|
||||||
|
new browser window instead.
|
||||||
|
|
||||||
|
This is a send-only email address. Replies to this message will not
|
||||||
|
be read or answered.
|
||||||
|
</p>
|
||||||
|
{/template}
|
||||||
Reference in New Issue
Block a user