/** * Resets all REPLY-To addresses. */ public T resetReplyTo() { this.replyTo = EmailAddress.EMPTY_ARRAY; return _this(); }
/** * Sets message subject. * * @param subject The message subject to set. * @return this */ public T subject(final String subject) { this.subject = subject; return _this(); }
/** * Resets all CC addresses. */ public T resetCc() { this.cc = EmailAddress.EMPTY_ARRAY; return _this(); }
/** * Sets email's sent date. * * @param date - Email's sent date. If {@code null}, then date will be set during the process of sending. * @return this */ public T sentDate(final Date date) { sentDate = date; return _this(); }
/** * Sets the FROM address. * * @param from {@link EmailAddress}. * @return this */ public T from(final EmailAddress from) { this.from = from; return _this(); }
/** * Resets TO addresses. */ public T resetTo() { this.to = EmailAddress.EMPTY_ARRAY; return _this(); }
/** * Adds {@link EmailAttachment}s. * * @param attachments {@link List} of {@link EmailAttachment}s to add. * @return this */ protected T storeAttachments(final List<EmailAttachment<? extends DataSource>> attachments) { this.attachments.addAll(attachments); return _this(); }
/** * Sets header value. * * @param name The name of the header. * @param value The value of the header. * @return this */ public T header(final String name, final String value) { headers.put(name, value); return _this(); }
/** * Adds multiple messages. * * @param msgsToAdd {@link List} of {@link EmailMessage}s to add. * @return this */ public T message(final List<EmailMessage> msgsToAdd) { messages.addAll(msgsToAdd); return _this(); }
/** * Adds an {@link EmailMessage}. * * @param msgToAdd {@link EmailMessage} to add. * @return this */ public T message(final EmailMessage msgToAdd) { messages.add(msgToAdd); return _this(); }
/** * Sets headers. * * @param headersToSet Headers to set. * @return this */ public T headers(final Map<String, String> headersToSet) { headers.putAll(headersToSet); return _this(); }
/** * Adds {@link EmailAttachment}. * * @param attachment {@link EmailAttachment} to add. * @return this */ protected T storeAttachment(final EmailAttachment<? extends DataSource> attachment) { this.attachments.add(attachment); return _this(); }
/** * Appends TO addresses. * * @param tos vararg of {@link EmailAddress}es to set. * @return this */ public T to(final EmailAddress... tos) { this.to = valueOrEmptyArray(tos); return _this(); }
/** * Appends REPLY-TO address. * * @param replyTo {@link EmailAddress} to add. * @return this */ public T replyTo(final EmailAddress replyTo) { this.replyTo = ArraysUtil.append(this.replyTo, replyTo); return _this(); }
/** * Sets email priority. * * @param priority - Values of 1 through 5 are acceptable, with 1 being the highest priority, 3 = normal * and 5 = lowest priority. */ public T priority(final int priority) { header(X_PRIORITY, String.valueOf(priority)); return _this(); }
/** * Adds {@link EmailAttachment}s. * * @param attachments {@link List} of {@link EmailAttachment}s to add. * @return this */ public T attachments(final List<EmailAttachment<? extends DataSource>> attachments) { for (final EmailAttachment<?> attachment : attachments) { attachment(attachment); } return _this(); }
/** * Appends TO address. * * @param to {@link EmailAddress} to add. * @return this */ public T to(final EmailAddress to) { this.to = ArraysUtil.append(this.to, to); return _this(); }
/** * Appends CC address. * * @param to {@link EmailAddress} to add. * @return this */ public T cc(final EmailAddress to) { this.cc = ArraysUtil.append(this.cc, to); return _this(); }
/** * Appends REPLY-TO addresses. * * @param replyTo vararg of {@link EmailAddress}es to set. * @return this */ public T replyTo(final EmailAddress... replyTo) { this.replyTo = ArraysUtil.join(this.replyTo, valueOrEmptyArray(replyTo)); return _this(); }
/** * Appends CC addresses. * * @param ccs vararg of {@link EmailAddress}es to set. * @return this */ public T cc(final EmailAddress... ccs) { this.cc = ArraysUtil.join(this.cc, valueOrEmptyArray(ccs)); return _this(); }