[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: |
|
|||||||||||||||||||||||||
| Sub-Tasks: |
|
|||||||||||||||||||||||||
| 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: | ||||||||||||||||||||||||||
| Description |
Steps to reproduce
Expected resultsThe email is properly retrieved from the external user and the email is sent Actual resultsUnsoportedOperationException is thrown WorkaroundN/A Development notesWhen 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);
DiscoveryRegarding 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) |