utils

package
v0.0.0-...-182b9a3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildMessage

func BuildMessage(subject string, user *slack.User, htmlBody string, recipients []string) *gomail.Message

BuildMessage fill email headers with given data

func CompareStringDates

func CompareStringDates(date1 string, date2 string) (int, error)

CompareStringDates compare both given string dates return -1 if date1 before date2 return 0 if date1 equal to date2 return 1 if date1 after date2 return error if dates are invalid

func ExtractEmails

func ExtractEmails(text string) string

ExtractEmails get the first email sent by a user Slack message string

func HasString

func HasString(haystack string, needle string) bool

HasString search substring in a given string

func IsFutureStringDate

func IsFutureStringDate(date string) (bool, error)

IsFutureStringDate check if giver string date is after today return true if date > today and false otherwise return error if string date is invalid

func ParseDate

func ParseDate(date string) (time.Time, error)

ParseDate parse string date by "02/01/2006" date format

func SendEmail

func SendEmail(message *gomail.Message) bool

SendEmail send email with given message by configuration properties

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL