IDEMPIERE-2554 Mail : add acknowledgement of receipt
This commit is contained in:
parent
526388b39c
commit
7d3473c52e
|
@ -184,6 +184,10 @@ public final class EMail implements Serializable
|
|||
m_smtpPort = smtpPort;
|
||||
}
|
||||
|
||||
public void setAcknoledgmentReceipt(boolean ar) {
|
||||
m_acknowledgementReceipt = ar;
|
||||
}
|
||||
|
||||
/** From Address */
|
||||
private InternetAddress m_from;
|
||||
/** To Address */
|
||||
|
@ -204,7 +208,7 @@ public final class EMail implements Serializable
|
|||
private String m_smtpHost;
|
||||
private int m_smtpPort;
|
||||
private boolean m_secureSmtp;
|
||||
|
||||
private boolean m_acknowledgementReceipt;
|
||||
|
||||
/** Attachments */
|
||||
private ArrayList<DataSource> m_attachments;
|
||||
|
@ -335,6 +339,8 @@ public final class EMail implements Serializable
|
|||
//
|
||||
m_msg.setSentDate(new java.util.Date());
|
||||
m_msg.setHeader("Comments", "iDempiereMail");
|
||||
if (m_acknowledgementReceipt)
|
||||
m_msg.setHeader("Disposition-Notification-To", m_from.getAddress());
|
||||
// m_msg.setDescription("Description");
|
||||
// SMTP specifics
|
||||
//m_msg.setAllow8bitMIME(true);
|
||||
|
|
|
@ -29,10 +29,13 @@ import java.util.StringTokenizer;
|
|||
import java.util.logging.Level;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.activation.DataSource;
|
||||
|
||||
import org.adempiere.webui.AdempiereWebUI;
|
||||
import org.adempiere.webui.component.AttachmentItem;
|
||||
import org.adempiere.webui.component.Button;
|
||||
import org.adempiere.webui.component.Checkbox;
|
||||
import org.adempiere.webui.component.Column;
|
||||
import org.adempiere.webui.component.Columns;
|
||||
import org.adempiere.webui.component.ConfirmPanel;
|
||||
|
@ -202,6 +205,7 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
|
|||
private ConfirmPanel confirmPanel = new ConfirmPanel(true);
|
||||
private Button bAddDefaultMailText;
|
||||
private Div attachmentBox;
|
||||
private Checkbox isAcknowledgmentReceipt = new Checkbox();
|
||||
|
||||
@Override
|
||||
public void onPageAttached(Page newpage, Page oldpage) {
|
||||
|
@ -227,6 +231,7 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
|
|||
lSubject.setValue(Msg.getMsg(Env.getCtx(), "Subject") + ":");
|
||||
lAttachment.setValue(Msg.getMsg(Env.getCtx(), "Attachment") + ":");
|
||||
fFrom.setReadonly(true);
|
||||
isAcknowledgmentReceipt.setLabel(Msg.getMsg(Env.getCtx(), "Acknowledge"));
|
||||
//
|
||||
|
||||
Grid grid = new Grid();
|
||||
|
@ -266,7 +271,7 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
|
|||
|
||||
row = new Row();
|
||||
rows.appendChild(row);
|
||||
row.appendChild(new Label(""));
|
||||
row.appendChild(isAcknowledgmentReceipt);
|
||||
row.appendChild(fTo);
|
||||
fTo.setHflex("1");
|
||||
|
||||
|
@ -523,6 +528,8 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
|
|||
email.addAttachment(ds);
|
||||
}
|
||||
|
||||
email.setAcknoledgmentReceipt(isAcknowledgmentReceipt.isChecked());
|
||||
|
||||
status = email.send();
|
||||
//
|
||||
if (m_user != null)
|
||||
|
|
Loading…
Reference in New Issue