Uploaded by bridgetk123

MailerService sendSimpleMail

advertisement
title MailerService_sendSimpleMail
participant Client
participant MailerService
participant Mailer
participant SimpleMailMessage
participant JavaMailSender
participant MailException
participant Logger
activate Client
Client->MailerService:sendSimpleMail(from: String, to: String, \nsubject: String, body: String): void
activate MailerService
MailerService->Mailer:sendSimpleMail(from: String, to: String, \nsubject: String, body: String): void
activate Mailer
Mailer-->>*SimpleMailMessage:<<create>>
Mailer->SimpleMailMessage:setFrom(from: String = from): void
activate SimpleMailMessage
Mailer<<--SimpleMailMessage:: void
deactivate SimpleMailMessage
Mailer->SimpleMailMessage:setTo(to: String = to): void
activate SimpleMailMessage
Mailer<<--SimpleMailMessage:: void
deactivate SimpleMailMessage
Mailer->SimpleMailMessage:setSubject(subject: String = subject): void
activate SimpleMailMessage
Mailer<<--SimpleMailMessage:: void
deactivate SimpleMailMessage
Mailer->SimpleMailMessage:setText(text: String = body): void
activate SimpleMailMessage
Mailer<<--SimpleMailMessage:: void
deactivate SimpleMailMessage
alt if !host.equals("fake-host") && (to != null && to.trim().length() != 0)
Mailer->JavaMailSender:send(simpleMessage: SimpleMailMessage = simpleMailMessage): void
activate JavaMailSender
alt MailException
JavaMailSender-->>*MailException:throw
end
Mailer<<--JavaMailSender:: void
deactivate JavaMailSender
else if to == null || to.trim().length() == 0
Mailer->Logger:info(): void
activate Logger
Mailer<<--Logger:: void
deactivate Logger
else if host.equals("fake-host")
Mailer->Logger:info(): void
activate Logger
Mailer<<--Logger:: void
deactivate Logger
end
MailerService<<--Mailer:: void
deactivate Mailer
Client<<--MailerService:: void
deactivate MailerService
Download