Skip to content

Commit

Permalink
send mail command result in mailservicestate
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmpp committed Mar 7, 2024
1 parent 479177b commit f1c9582
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/main/scala/ch/openolitor/core/security/LoginService.scala
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package ch.openolitor.core.security

import akka.http.caching.scaladsl.{ Cache, CachingSettings }
import akka.http.caching.scaladsl.{Cache, CachingSettings}
import akka.http.caching.LfuCache
import akka.pattern.ask
import akka.util.Timeout
import ch.openolitor.core.{ ActorReferences, ExecutionContextAware, SystemConfigReference }
import ch.openolitor.core.{ActorReferences, ExecutionContextAware, SystemConfigReference}
import ch.openolitor.core.Macros.copyTo
import ch.openolitor.core.db.AsyncConnectionPoolContextAware
import ch.openolitor.core.domain.SystemEvents
import ch.openolitor.core.mailservice.Mail
import ch.openolitor.core.mailservice.MailService.{ SendMailCommand, SendMailEvent }
import ch.openolitor.core.mailservice.MailService.{MailServiceState, SendMailCommand, SendMailEvent}
import ch.openolitor.core.models.PersonId
import ch.openolitor.stammdaten.StammdatenCommandHandler.{ PasswortGewechseltEvent, PasswortResetCommand, PasswortResetGesendetEvent, PasswortWechselCommand }
import ch.openolitor.stammdaten.StammdatenCommandHandler.{PasswortGewechseltEvent, PasswortResetCommand, PasswortResetGesendetEvent, PasswortWechselCommand}
import ch.openolitor.stammdaten.models._
import ch.openolitor.stammdaten.repositories.StammdatenReadRepositoryAsyncComponent
import ch.openolitor.util.ConfigUtil._
Expand Down Expand Up @@ -351,7 +351,7 @@ trait LoginService extends LazyLogging
val mail = Mail(1, person.email.get, None, None, None, "OpenOlitor Second Factor",
s"""Code: ${secondFactor.code}""", None)
mailService ? SendMailCommand(SystemEvents.SystemPersonId, mail, Some(5 minutes)) map {
case _: SendMailEvent =>
case _: SendMailEvent | MailServiceState =>
true.right
case other =>
logger.debug(s"Sending Mail failed resulting in $other")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class DefaultMailCommandForwarder(mailService: ActorRef) extends MailCommandForw
case None => mailPayload.toMail(1, email, None, None, replyTo, docReference)
}
mailService ? SendMailCommandWithCallback(originator, mail, Some(60 minutes), person.id) map {
case _: SendMailEvent =>
case _: SendMailEvent | MailServiceState =>
//ok
case other =>
logger.debug(s"Sending Mail failed resulting in $other")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ abstract class StammdatenAktionenService(override val sysConfig: SystemConfig, o
val mail = mailPayload.toMail(1, produzent.email, None, None, None, None)
mailService ? SendMailCommandWithCallback(personId, mail, Some(60 minutes), id) map
{
case _: SendMailEvent =>
case _: SendMailEvent | MailServiceState =>
//ok
case other =>
logger.debug(s"Sending Mail failed resulting in $other")
Expand Down Expand Up @@ -274,7 +274,7 @@ abstract class StammdatenAktionenService(override val sysConfig: SystemConfig, o
val mail = mailPayload.toMail(1, person.email.get, None, None, None, None)
mailService ? SendMailCommandWithCallback(originator, mail, Some(60 minutes), einladung.id) map
{
case _: SendMailEvent =>
case _: SendMailEvent | MailServiceState =>
//ok
case other =>
logger.debug(s"Sending Mail failed resulting in $other")
Expand Down

0 comments on commit f1c9582

Please sign in to comment.