message-api

Send emails and RocketChat messages

View readme on GitLab

messaging.proto

syntax = "proto3";
package messaging;

// An API key must be provided in an "authorization" header in GRPC metadata.

service Messaging {
    // Send a message via Mail - this needs privileged access
    rpc SendMail (MailRequest) returns (MailResponse);

    // Send a message to the internal VIS Chat system
    rpc SendInternalIM (ImRequest) returns (ImResponse);
    // Send a message to the external VIS Chat system
    rpc SendExternalIM (ImRequest) returns (ImResponse);

    // Send an info message to the VIS Chat System
    // This endpoint should be used for logging information that admins shold know
    rpc SendInfo (LogRequest) returns (LogResponse);
    // Send a warning message to the VIS Chat System
    // This endpoint should be used for logging information that admins shold know
    rpc SendWarning (LogRequest) returns (LogResponse);
    // Send a error message to the VIS Chat System
    // This endpoint should be used for logging information that admins shold 
    // really urgently know about - it will even send a mail in case of failed IM
    rpc SendError (LogRequest) returns (LogResponse);
}

message MailRequest {
// The name to display when sending as sys user e.g. Admin. Due to technical 
// reasons it will always be the same sending address
// i.e. the sending address needs to be 'sys_staging@vis.ethz.ch' (staging) or
// 'sys_message_api@vis.ethz.ch' (production).
// If you want to set a custom sending address e.g. '<appname>@vis.ethz.ch',
// then you need to create a mailalias from '<appname>@vis.ethz.ch' to
// 'sys_staging@vis.ethz.ch' (staging) or 'sys_message_api@vis.ethz.ch' (production)
// respectively and set 'can_send' to true.
    string from = 1; 
    string reply_to = 2; // What address to reply to. e.g. "LUK <luk@vis.ethz.ch>"
    repeated string to = 3; // List of to. Format: "Admin <root@vis.ethz.ch>" - will result in error if not provided
    repeated string cc = 4; //  List of cc. Format: "Admin <root@vis.ethz.ch>"
    repeated string bcc = 5; // List of bcc.
    string subject = 6; // Subject of the message - will result in error if not provided
    string body = 7; // The content of the message - will result in error if not provided
}

message MailResponse {
} //empty

message ImRequest {
    string recipient = 1; // The nethz of the recipient
    string text = 2; // Text to send to the recipient
}

message ImResponse {
} //empty

message LogRequest {
    string text = 1; // The log message to send
}

message LogResponse {
} //empty