IDEMPIERE-5823 - Improve MUserMail constructors to behave equally in every case (#1967)

This commit is contained in:
Diego Ruiz 2023-08-09 06:56:10 +02:00 committed by GitHub
parent e46d57e1ea
commit f1a0f7aac1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 25 deletions

View File

@ -34,7 +34,7 @@ public class MUserMail extends X_AD_UserMail
/**
*
*/
private static final long serialVersionUID = 925597416692485382L;
private static final long serialVersionUID = -6933973466878945692L;
/**
* UUID based Constructor
@ -79,15 +79,7 @@ public class MUserMail extends X_AD_UserMail
this (parent.getCtx(), 0, parent.get_TrxName());
setAD_User_ID(AD_User_ID);
setR_MailText_ID(parent.getR_MailText_ID());
setSenderAndRecipient(mail);
//
if (mail.isSentOK())
setMessageID(mail.getMessageID());
else
{
setMessageID(mail.getSentMsg());
setIsDelivered(ISDELIVERED_No);
}
setMailValues(mail);
} // MUserMail
/**
@ -101,36 +93,33 @@ public class MUserMail extends X_AD_UserMail
this (po.getCtx(), 0, null);
setClientOrg(po);
setAD_User_ID(AD_User_ID);
setSubject(mail.getSubject());
setMailText(mail.getMessageCRLF());
setSenderAndRecipient(mail);
//
if (mail.isSentOK())
setMessageID(mail.getMessageID());
else
{
setMessageID(mail.getSentMsg());
setIsDelivered(ISDELIVERED_No);
}
setMailValues(mail);
} // MUserMail
public MUserMail (Properties ctx, EMail mail)
{
this (ctx, 0, null);
setAD_User_ID(Env.getAD_User_ID(ctx));
setMailValues(mail);
} // MUserMail
/**
* Sets all columns related to the EMail
* Subject - Mail Text - Sender - Recipient - Message ID - IsDelivered
* @param mail
*/
private void setMailValues(EMail mail) {
setSubject(mail.getSubject());
setMailText(mail.getMessageCRLF());
setSenderAndRecipient(mail);
//
if (mail.isSentOK())
setMessageID(mail.getMessageID());
else
{
else {
setMessageID(mail.getSentMsg());
setIsDelivered(ISDELIVERED_No);
}
} // MUserMail
}
/**
* Is it Delivered