Package google.registry.ui.server
Class SendEmailUtils
java.lang.Object
google.registry.ui.server.SendEmailUtils
Utility class for sending emails from the app.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSendEmailUtils
(com.google.common.collect.ImmutableList<String> registrarChangesNotificationEmailAddresses, GmailClient gmailClient) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether there are any recipients set up.boolean
Sends an email from Nomulus to the registrarChangesNotificationEmailAddresses.boolean
sendEmail
(String subject, String body, com.google.common.collect.ImmutableList<String> additionalAddresses) Sends an email from Nomulus to the registrarChangesNotificationEmailAddresses and the specified additionalAddresses.boolean
sendEmail
(String subject, String body, Optional<String> bcc, com.google.common.collect.ImmutableList<String> additionalAddresses) Sends an email from Nomulus to the registrarChangesNotificationEmailAddresses, the bcc address, and the specified additionalAddresses.
-
Field Details
-
gmailClient
-
-
Constructor Details
-
SendEmailUtils
@Inject public SendEmailUtils(@Config("registrarChangesNotificationEmailAddresses") com.google.common.collect.ImmutableList<String> registrarChangesNotificationEmailAddresses, GmailClient gmailClient)
-
-
Method Details
-
sendEmail
public boolean sendEmail(String subject, String body, Optional<String> bcc, com.google.common.collect.ImmutableList<String> additionalAddresses) Sends an email from Nomulus to the registrarChangesNotificationEmailAddresses, the bcc address, and the specified additionalAddresses. Returns true iff sending to at least 1 address was successful.This means that if there are no recipients (
hasRecipients()
returns false), this will return false even thought no error happened.This also means that if there are multiple recipients, it will return true even if some (but not all) of the recipients had an error.
-
sendEmail
public boolean sendEmail(String subject, String body, com.google.common.collect.ImmutableList<String> additionalAddresses) Sends an email from Nomulus to the registrarChangesNotificationEmailAddresses and the specified additionalAddresses. Returns true iff sending to at least 1 address was successful.This means that if there are no recipients (
hasRecipients()
returns false), this will return false even thought no error happened.This also means that if there are multiple recipients, it will return true even if some (but not all) of the recipients had an error.
-
sendEmail
Sends an email from Nomulus to the registrarChangesNotificationEmailAddresses. -
hasRecipients
public boolean hasRecipients()Returns whether there are any recipients set up.sendEmail(java.lang.String, java.lang.String, java.util.Optional<java.lang.String>, com.google.common.collect.ImmutableList<java.lang.String>)
will always return false if there are no recipients.
-