[MGNLMAIL-145] Send Email for external User (SSO-3.0.0) fails Created: 30/Sep/22  Updated: 17/Feb/23  Resolved: 27/Oct/22

Status: Closed
Project: Magnolia Mail Module
Component/s: None
Affects Version/s: 5.5.14
Fix Version/s: 5.5.15

Type: Bug Priority: Critical
Reporter: Carlos Cantalapiedra Assignee: Nguyen Phung Chi
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: 1.5d Time Spent: 1.5d
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Issue Links:
Problem/Incident
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLMAIL-147 Implementation Technical task Completed Nguyen Phung Chi  
MGNLMAIL-148 Review Technical task Completed Evzen Fochr  
MGNLMAIL-149 PiQA Technical task Closed  
MGNLMAIL-150 Final QA Technical task Completed Nguyen Phung Chi  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: SSO maintenance
Sprint: AdminX 21
Story Points: 1
Team: AdminX

 Description   

Steps to reproduce

  1.  Use an instance which has SSO-3.0.0 installed
  2.  Configure SSO module to map email attribute from the openID
  3.  Check that when Mail modules tries to send an email it fails throwing an UnsoportedOperationException

Expected results

The email is properly retrieved from the external user and the email is sent

Actual results

UnsoportedOperationException is thrown

Workaround

N/A

Development notes

When the MailVerifyPresenter class (method sendSimpleMail) tries to send the email, it fails because it does't check it the user is MgnlUser or an ExternalUser:

MailVerifyPresenter.java
String userEmailAddress = PropertyUtil.getString(SessionUtil.getNodeByIdentifier(RepositoryConstants.USERS, MgnlContext.getUser().getIdentifier()), PROPERTY_EMAIL);

Discovery

Regarding this specific problem, in fact the user email can be retrieved using MgnlContext.getUser().getProperty("email") which is a generic way for both MgnlUser and ExternalUser

Notes: Apply the same fix for both methods MailVerifyPresenter#sendSimpleMail and MailVerifyPresenter#sendTemplateMail (source code)


Generated at Mon Feb 12 06:04:04 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.