aicam commented on code in PR #3729:
URL: https://github.com/apache/texera/pull/3729#discussion_r2345118204
##########
core/amber/src/main/scala/edu/uci/ics/texera/web/resource/EmailTemplate.scala:
##########
@@ -53,11 +49,8 @@ object EmailTemplate {
): EmailMessage = {
if (toAdmin) {
val subject =
- if (deployment.nonEmpty)
- s"New Account Request to $deployment Pending Approval"
- else
- "New Account Request Pending Approval"
-
+ s"New Account Request Pending Approval${if (deployment.nonEmpty) s"
for [$deployment]"
Review Comment:
Create constant of the fix part of the subject, for example
`REGISTERATION_EMAIL_SUBJECT="New Account Request Pending Approval"`
##########
core/amber/src/main/scala/edu/uci/ics/texera/web/resource/EmailTemplate.scala:
##########
@@ -29,11 +29,7 @@ import
edu.uci.ics.texera.dao.jooq.generated.enums.UserRoleEnum
object EmailTemplate {
private val deployment: String = {
- val config = ConfigFactory.load()
- val rawDomain =
- if (config.hasPath("user-sys.domain"))
config.getString("user-sys.domain")
- else ""
- rawDomain.replaceFirst("^https?://", "")
+ UserSystemConfig.appDomain.map(_.replaceFirst("^https?://",
"")).getOrElse("")
Review Comment:
The `{` and `}` are redundant
##########
core/amber/src/main/scala/edu/uci/ics/texera/web/resource/EmailTemplate.scala:
##########
@@ -73,7 +66,8 @@ object EmailTemplate {
|""".stripMargin
EmailMessage(subject = subject, content = content, receiver =
receiverEmail)
} else {
- val subject = "Account Request Received"
+ val subject =
+ s"Account Request Received${if (deployment.nonEmpty) s" for
[$deployment]" else ""}"
Review Comment:
Ditto
##########
core/amber/src/main/scala/edu/uci/ics/texera/web/resource/EmailTemplate.scala:
##########
@@ -98,11 +92,7 @@ object EmailTemplate {
*/
def createRoleChangeTemplate(receiverEmail: String, newRole: UserRoleEnum):
EmailMessage = {
val subject =
- if (deployment.nonEmpty)
- s"Your Role Has Been Updated on $deployment"
- else
- "Your Role Has Been Updated"
-
+ s"Your Role Has Been Updated${if (deployment.nonEmpty) s" for
[$deployment]" else ""}"
Review Comment:
Ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]