Skip to content

Commit

Permalink
Add 'from' support to MessageCreateOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
jm-mailosaur committed Sep 6, 2022
1 parent cd41fb6 commit f07b38e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/main/java/com/mailosaur/models/MessageCreateOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ public class MessageCreateOptions {
@Key
private String to;

/**
* Allows for the partial override of the message's 'from' address. This **must** be
* an address ending with `YOUR_SERVER.mailosaur.net`, such as `[email protected]`.
*/
@Key
private String from;

/**
* If true, email will be sent upon creation.
*/
Expand Down Expand Up @@ -55,6 +62,18 @@ public MessageCreateOptions withTo(String to) {
return this;
}

/**
* Partially overrides of the message's 'from' address. This **must** be an address ending
* with `YOUR_SERVER.mailosaur.net`, such as `[email protected]`.
*
* @param from The email address.
* @return the MessageCreateOptions object itself.
*/
public MessageCreateOptions withFrom(String from) {
this.from = from;
return this;
}

/**
* Sets whether the email should be sent upon creation.
*
Expand Down

0 comments on commit f07b38e

Please sign in to comment.