Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MessageStatusCodes = map[int]string{
100: "Processed",
101: "Sent",
102: "Queued",
401: "RiskHold",
402: "InvalidSenderId",
403: "InvalidPhoneNumber",
404: "UnsupportedNumberType",
405: "InsufficientBalance",
406: "UserInBlacklist",
407: "CouldNotRoute",
409: "DoNotDisturbRejection",
500: "InternalServerError",
501: "GatewayError",
502: "RejectedByGateway",
}
MessageStatusCodes maps specific status codes to their corresponding messages.
Functions ¶
func GetStatusMessage ¶
GetStatusMessage retrieves the human-readable message corresponding to an HTTP status code. It returns "Unknown Status Code" if the code is not found in the predefined map.
func SendEmail ¶
func SendEmail(smtpHost string, smtpPort int, username, password string, InsecureSkipVerify bool, details models.EmailDetails) error
SendEmail sends an email using the provided SMTP server details and email content. smtpHost: The SMTP server host (e.g., "smtp.gmail.com"). smtpPort: The SMTP server port (e.g., 587 for TLS). username: The SMTP username (e.g., email address of sender). password: The SMTP password (or app-specific password). InsecureSkipVerify: A flag to allow insecure SSL connections (use with caution).
func SendSMS ¶
func SendSMS(payload models.SMSPayload) (models.SMSResponse, error)
SendSMS sends a bulk SMS request to the Africa's Talking API. It marshals the payload into JSON, sends a POST request, and returns the response or an error.
Types ¶
This section is empty.