Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/resend/resend-java

Resend's Java SDK
https://github.com/resend/resend-java

Last synced: 5 days ago
JSON representation

Resend's Java SDK

Awesome Lists containing this project

README

        

# Resend Java SDK

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
![Build](https://github.com/resendlabs/resend-java/actions/workflows/ci.yml/badge.svg)
![Release](https://img.shields.io/github/release/resendlabs/resend-java.svg?style=flat-square)
---

## Installation

To install the Java SDK, add the following dependency to your project:

Gradle

```gradle
implementation 'com.resend:resend-java:3.2.0'
```

Maven

```Maven

com.resend
resend-java
3.2.0

```
## Setup

First, you need to get an API key, which is available in the [Resend Dashboard](https://resend.com).
## Example

```java
package com.resend;

import com.resend.services.emails.model.*;
import com.resend.core.provider.AuthenticationProvider;
import com.resend.core.provider.impl.AuthenticationProviderStandard;
import com.resend.services.emails.ResendEmails;

public class Main {
public static void main(String[] args) {
Resend resend = new Resend("re_123");

CreateEmailOptions params = CreateEmailOptions.builder()
.from("Me ")
.to("to@example", "[email protected]")
.cc("[email protected]", "[email protected]")
.bcc("[email protected]", "[email protected]")
.replyTo("[email protected]", "[email protected]")
.text("Hello, world!")
.subject("Hello from Java!")
.build();

try {
CreateEmailResponse data = resend.emails().send(params);
System.out.println(data.getId());
} catch (ResendException e) {
e.printStackTrace();
}
}
}

```

You can view all the examples in the [examples folder](https://github.com/resendlabs/resend-java-example)