Skip to content
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

feat(api): add email.proto #729

Merged
merged 14 commits into from
Aug 19, 2022
108 changes: 108 additions & 0 deletions spec/proto/runtime/v1/email.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
syntax = "proto3";

package spec.proto.runtime.v1;

import "google/protobuf/empty.proto";
import "google/protobuf/any.proto";

option go_package = "mosn.io/layotto/spec/proto/runtime/v1;runtime";

service EmailTemplateService {

// Send an email with template
rpc SendEmailWithTemplate(SendEmailWithTemplateRequest) returns (SendEmailWithTemplateResponse) {}

}

service EmailService {

// Send an email.
rpc SendEmail(SendEmailRequest) returns (SendEmailResponse) {}

}

// SendEmailWithTemplateRequest is the message send to email.
message SendEmailWithTemplateRequest {

// The saas service name, like 'aliyun.email'/'aws.ses'/'...'
// If your system uses multiple IVR services at the same time,
// you can specify which service to use with this field.
string service_name = 1;

// Required.
EmailTemplate template = 2;


// Required. The Email subject.
string subject = 3;

// Required. The Email sender address.
string from_address = 4;

// Required. The Email destination addresses.
repeated string to_addresses = 5;

// Optional. To whom the mail is cc
repeated string cc = 6;

}

message EmailTemplate{

// Required
string template_id = 1;

// Required
map<string, string> template_params = 2;

}

message SendEmailWithTemplateResponse {

// The saas requestId.
string request_id = 1;

}

// SendEmailRequest is the message send to email.
message SendEmailRequest {

// The saas service name, like 'aliyun.email'/'aws.ses'/'...'
// If your system uses multiple IVR services at the same time,
// you can specify which service to use with this field.
string service_name = 1;

// Required.
string setting_id = 2;

// Required. The Email subject.
string subject = 3;

// Required.
Content content = 4;

// Required. The Email sender address.
string from_address = 5;

// Required. The Email destination addresses.
repeated string to_addresses = 6;

// Optional. To whom the mail is cc
repeated string cc = 7;
seeflood marked this conversation as resolved.
Show resolved Hide resolved

}

message Content{

// Required.
string text = 1;

}


message SendEmailResponse {

// The saas requestId.
string request_id = 1;

}