Ir a la documentación
Go

client.FollowUps

Cada método de este espacio de nombres: su firma, sus parámetros, lo que devuelve y un ejemplo.

Métodos

Reminders on mail you sent: ask for a thread to come back to the top of the inbox if nobody replies by a time you choose, list the reminders still waiting and the ones that ended, and cancel one.

FollowUps.List

List reminders

Alcancesthreads:read
Firma
List(ctx context.Context, opts ...openemail.RequestOption) ([]openemail.Object, error)

Returns the reminders you set on mail you sent, newest first: the ones still waiting for a reply and the ones that ended. A reminder is waiting until somebody replies (answered), its time comes with no reply (due, and the thread is back at the top of the inbox, unread) or it is cancelled.

An API key lists the reminders of the workspace owner, and an app those of the person who connected it. A key or an app limited to particular addresses lists only reminders on threads delivered to them. They come back as one plain array with no paging, and limit caps how many.

Parámetros

openemail.WithStatus...string

Only reminders in this state: waiting, answered, due or cancelled.

openemail.WithThreadIDstring

Only the reminders on this thread.

openemail.WithLimitint

How many to return, newest first, from 1 to 200. 100 when left out.

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Devuelve

A []openemail.Object, each a map with object set to follow_up, id, threadId, messageId, emailId, subject, remindAt, status, answeredAt, firedAt and createdAt. threadId is null until a scheduled message with a reminder goes out, emailId names the email when the reminder was set with followUpAt, answeredAt is null unless answered and firedAt is null unless due.

Ejemplo

waiting, err := client.FollowUps.List(ctx, openemail.WithStatus("waiting"))if err != nil {	return err} for _, up := range waiting {	fmt.Println(up.String("subject"), up.String("remindAt"))}

Notas

  • In query, is:waiting finds the same conversations through Threads.List: the ones with a reminder nobody has answered yet.

  • Read only, so the SDK retries it after a network failure like any other read.

También disponible en

API
GET /follow-ups
TypeScript
followUps.list()
Python
follow_ups.list()
Ruby
follow_ups.list
PHP
followUps->list
Java
followUps().list
C#
FollowUps.ListAsync
CLI
openemail follow-ups list

FollowUps.Set

Set a reminder on a thread

Alcancesthreads:write
Firma
Set(ctx context.Context, body openemail.Body, opts ...openemail.RequestOption) (openemail.Object, error)

Asks to be reminded about a thread if nobody replies by remindAt. If a real reply arrives first, the reminder closes by itself. Otherwise, when the time comes, the thread returns to the top of the inbox, unread, with the built-in FOLLOW_UP label and a push to your phones. Automatic replies, delivery reports and your own sending address do not count as a reply.

A thread holds one waiting reminder per person, so setting another moves the time. remindAt takes a time.Time or an ISO 8601 string with an offset. To set one as you send, pass followUpAt to Emails.Send instead.

Parámetros

threadIdstringObligatorio

The thread to be reminded about, as Threads.List returns it.

remindAttime.Time | stringObligatorio

When the thread comes back if nobody replied: a future instant, at most 365 days out.

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Devuelve

An openemail.Object, the reminder with status set to waiting: a map with object set to follow_up, id, threadId, messageId, emailId, subject, remindAt, status, answeredAt, firedAt and createdAt.

Ejemplo

reminder, err := client.FollowUps.Set(ctx, openemail.Body{	"threadId": "CAHk7pQ2x9LmZ4-mail.example.com",	"remindAt": time.Now().AddDate(0, 0, 3),})if err != nil {	return err} fmt.Println(reminder.ID(), reminder.String("status"), reminder.Time("remindAt"))

Notas

  • A remindAt that is not in the future, or is more than 365 days out, is a 422 invalid_follow_up. A thread that does not exist, or one delivered to no address the key covers, is a 404.

  • An API key sets the reminder for the workspace owner, and an app for the person who connected it. The push goes out unless that person turned phoneFollowUps off in settings.

  • The SDK retries this call after a network failure, which is safe because setting the same time twice leaves one reminder.

También disponible en

API
POST /follow-ups
TypeScript
followUps.set()
Python
follow_ups.set()
Ruby
follow_ups.set
PHP
followUps->set
Java
followUps().set
C#
FollowUps.SetAsync
CLI
openemail follow-ups set

FollowUps.Cancel

Cancel a reminder

Alcancesthreads:write
Firma
Cancel(ctx context.Context, id string, opts ...openemail.RequestOption) (openemail.Object, error)

Cancels a waiting reminder, so the thread stays where it is when the time comes. A reminder that already ended is returned as it is, which is why the SDK retries this call. Only your own reminders can be cancelled.

Parámetros

idstringObligatorio

The id of the reminder, fup_ and 24 hex characters, as List returns it.

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Devuelve

An openemail.Object, the reminder as it is now: cancelled when it was waiting, and unchanged when it had already ended.

Ejemplo

cancelled, err := client.FollowUps.Cancel(ctx, "fup_4c1b257a9e3d6f8025b7c1d4")if err != nil {	return err} fmt.Println(cancelled.String("status"), cancelled.String("remindAt"))

Notas

  • An unknown id, and a reminder somebody else set, are each a 404. So is one on a thread delivered to no address the key covers.

  • A cancelled reminder is kept, and List returns it with status set to cancelled.

También disponible en

API
DELETE /follow-ups/{id}
TypeScript
followUps.cancel()
Python
follow_ups.cancel()
Ruby
follow_ups.cancel
PHP
followUps->cancel
Java
followUps().cancel
C#
FollowUps.CancelAsync
CLI
openemail follow-ups cancel