mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
53 lines
1.1 KiB
Protocol Buffer
53 lines
1.1 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package email;
|
|
|
|
option go_package = "./proto;email";
|
|
|
|
service Email {
|
|
rpc Send(SendRequest) returns (SendResponse) {}
|
|
rpc Parse(ParseRequest) returns (ParseResponse) {}
|
|
rpc Validate(ValidateRequest) returns (ValidateResponse) {}
|
|
}
|
|
|
|
// Send an email by passing in from, to, subject, and a text or html body
|
|
message SendRequest {
|
|
// the display name of the sender
|
|
string from = 1;
|
|
// the email address of the recipient
|
|
string to = 2;
|
|
// an optional reply to email address
|
|
string reply_to = 3;
|
|
// the email subject
|
|
string subject = 4;
|
|
// the text body
|
|
string text_body = 5;
|
|
// the html body
|
|
string html_body = 6;
|
|
}
|
|
|
|
message SendResponse {
|
|
}
|
|
|
|
// Parse an RFC5322 address e.g "Joe Blogs <joe@example.com>"
|
|
message ParseRequest {
|
|
// The address to parse. Can be of the format "Joe Blogs <joe@example.com>" or "joe@example.com"
|
|
string address = 1;
|
|
}
|
|
|
|
message ParseResponse {
|
|
// associated name e.g Joe Blogs
|
|
string name = 1;
|
|
// the email address
|
|
string address = 2;
|
|
}
|
|
|
|
// Validate an email address format
|
|
message ValidateRequest {
|
|
string address = 1;
|
|
}
|
|
|
|
message ValidateResponse {
|
|
bool is_valid = 1;
|
|
}
|