Skip to content

update mailjet in compute to version 4.0.5 #384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compute/mailjet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<dependency>
<groupId>com.mailjet</groupId>
<artifactId>mailjet-client</artifactId>
<version>4.0.1</version>
<version>4.0.5</version>
</dependency>
<!-- [END dependencies] -->
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.mailjet.client.MailjetRequest;
import com.mailjet.client.MailjetResponse;
import com.mailjet.client.errors.MailjetException;
import com.mailjet.client.errors.MailjetSocketTimeoutException;
import com.mailjet.client.resource.Email;
// [END mailjet_imports]

Expand All @@ -30,7 +31,7 @@
// [START app]
public class MailjetSender{

public static void main(String[] args) {
public static void main(String[] args) throws MailjetException, MailjetSocketTimeoutException {
final String mailjetApiKey = "YOUR-MAILJET-API-KEY";
final String mailjetSecretKey = "YOUR-MAILJET-SECRET-KEY";
MailjetClient client = new MailjetClient(mailjetApiKey, mailjetSecretKey);
Expand All @@ -39,7 +40,8 @@ public static void main(String[] args) {
sender.sendMailjet(args[0], args[1], client);
}

public MailjetResponse sendMailjet(String recipient, String sender, MailjetClient client) {
public MailjetResponse sendMailjet(String recipient, String sender, MailjetClient client)
throws MailjetException, MailjetSocketTimeoutException {
MailjetRequest email = new MailjetRequest(Email.resource)
.property(Email.FROMEMAIL, sender)
.property(Email.FROMNAME, "pandora")
Expand Down