integrations

package
v0.0.0-...-a0cf74a Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const EXTERNAL_SYSTEM = "mailstack"

Variables

This section is empty.

Functions

func CalDotCom

func CalDotCom(c *gin.Context, s *service.Services)

func EmailWithBrackets

func EmailWithBrackets(s []string) string

func FathomZapier

func FathomZapier(c *gin.Context, s *service.Services)

func GrainZapier

func GrainZapier(c *gin.Context, s *service.Services)

func PostmarkDMARCMonitor

func PostmarkDMARCMonitor(s *service.Services) gin.HandlerFunc

func PostmarkInboundEmail

func PostmarkInboundEmail(c *gin.Context, s *service.Services)

func VerifyCalWebhookSignature

func VerifyCalWebhookSignature(payload []byte, signature string, secretKey string) (bool, error)

Types

type AISummary

type AISummary struct {
	HTMLFormatted      string `json:"html_formatted"`
	MarkdownFormatted  string `json:"markdown_formatted"`
	PlaintextFormatted string `json:"plaintext_formatted"`
	Sections           string `json:"sections"`
	SlackFormatted     string `json:"slack_formatted"`
	TemplateName       string `json:"template_name"`
}

AISummary represents the AI summary section

type Attendee

type Attendee struct {
	Email     string   `json:"email"`
	Name      string   `json:"name"`
	FirstName string   `json:"firstName"`
	LastName  string   `json:"lastName"`
	TimeZone  string   `json:"timeZone"`
	Language  Language `json:"language"`
	UTCOffset int      `json:"utcOffset"`
}

type Booking

type Booking struct {
	BookerURL           string              `json:"bookerUrl"`
	Type                string              `json:"type"`
	Title               string              `json:"title"`
	Description         string              `json:"description"`
	AdditionalNotes     string              `json:"additionalNotes,omitempty"`
	CustomInputs        map[string]string   `json:"customInputs"`
	StartTime           time.Time           `json:"startTime"`
	EndTime             time.Time           `json:"endTime"`
	Organizer           Organizer           `json:"organizer"`
	Responses           BookingResponses    `json:"responses"`
	UserFieldsResponses UserFieldsResponses `json:"userFieldsResponses"`
	Attendees           []Attendee          `json:"attendees"`
	Location            string              `json:"location"`
	DestinationCalendar []Calendar          `json:"destinationCalendar"`
	EventTypeID         int                 `json:"eventTypeId"`
	UID                 string              `json:"uid"`
	BookingID           int                 `json:"bookingId"`
	EventTitle          string              `json:"eventTitle"`
	EventDescription    string              `json:"eventDescription"`
	Price               int                 `json:"price"`
	Currency            string              `json:"currency"`
	Status              string              `json:"status"`
	Length              int                 `json:"length"`
	ICalUID             string              `json:"iCalUID"`
	ICalSequence        int                 `json:"iCalSequence"`

	// Fields specific to cancellation
	CancellationReason string `json:"cancellationReason,omitempty"`
	CancelledBy        string `json:"cancelledBy,omitempty"`

	// Fields specific to rescheduling
	RescheduleID        int       `json:"rescheduleId,omitempty"`
	RescheduleUID       string    `json:"rescheduleUid,omitempty"`
	RescheduleStartTime time.Time `json:"rescheduleStartTime,omitempty"`
	RescheduleEndTime   time.Time `json:"rescheduleEndTime,omitempty"`
	RescheduledBy       string    `json:"rescheduledBy,omitempty"`
}

Booking represents the main booking data structure

type BookingResponses

type BookingResponses struct {
	Name             ResponseField `json:"name"`
	Email            ResponseField `json:"email"`
	Notes            ResponseField `json:"notes,omitempty"`
	Guests           GuestsField   `json:"guests"`
	Location         LocationField `json:"location"`
	PhoneNumber      ResponseField `json:"phone-number"`
	RescheduleReason ResponseField `json:"rescheduleReason,omitempty"`
}

type CalDotComPayload

type CalDotComPayload struct {
	TriggerEvent string    `json:"triggerEvent"`
	CreatedAt    time.Time `json:"createdAt"`
	Payload      Booking   `json:"payload"`
}

WebhookPayload represents the root structure of all Cal.com webhooks

type Calendar

type Calendar struct {
	ID           int    `json:"id"`
	Integration  string `json:"integration"`
	ExternalID   string `json:"externalId"`
	PrimaryEmail string `json:"primaryEmail"`
	UserID       int    `json:"userId"`
	EventTypeID  *int   `json:"eventTypeId"`
	CredentialID int    `json:"credentialId"`
}

type ExternalDomain

type ExternalDomain struct {
	Domain string `json:"domain_name"`
}

type FathomUser

type FathomUser struct {
	Email string `json:"email"`
	Name  string `json:"name"`
}

FathomUser represents the user information

type FathomZapierPayload

type FathomZapierPayload struct {
	AISummary  AISummary  `json:"ai_summary"`
	FathomUser FathomUser `json:"fathom_user"`
	ID         string     `json:"id"`
	Meeting    Meeting    `json:"meeting"`
	Recording  Recording  `json:"recording"`
}

FathomWebhookPayload represents the root webhook payload

func (*FathomZapierPayload) ExternalDomains

func (f *FathomZapierPayload) ExternalDomains() []string

type GrainParticipant

type GrainParticipant struct {
	Name              string  `json:"name"`
	Scope             string  `json:"scope"`
	Email             *string `json:"email,omitempty"`
	ConfirmedAttendee bool    `json:"confirmed_attendee"`
}

Participant represents an individual participant in the recording

type GrainRecording

type GrainRecording struct {
	EndDatetime         time.Time          `json:"end_datetime"`
	ICalUID             string             `json:"ical_uid"`
	ID                  string             `json:"id"`
	IntelligenceNotesMD string             `json:"intelligence_notes_md"`
	OwnersStr           string             `json:"owners"`
	Owners              []string           `json:"ownersArr"`
	ParticipantsStr     string             `json:"participants"`
	Participants        []GrainParticipant `json:"participantsArray"`
	PublicThumbnailURL  string             `json:"public_thumbnail_url"`
	PublicURL           string             `json:"public_url"`
	StartDatetime       time.Time          `json:"start_datetime"`
	TagsStr             string             `json:"tags"`
	Tags                []string           `json:"tagsArray"`
	Title               string             `json:"title"`
	URL                 string             `json:"url"`
}

RecordingData contains the details of the recording

type GrainRecordingData

type GrainRecordingData struct {
	RecordingData GrainRecording `json:"data"`
	Type          string         `json:"type"`
	UserID        string         `json:"user_id"`
}

RecordingRes the top-level response structure

func (*GrainRecordingData) MeetingNoteContent

func (g *GrainRecordingData) MeetingNoteContent() string

type GuestsField

type GuestsField struct {
	Label    string   `json:"label"`
	Value    []string `json:"value"`
	IsHidden bool     `json:"isHidden,omitempty"`
}

type Invitee

type Invitee struct {
	Name       string `json:"name"`
	Email      string `json:"email"`
	IsExternal bool   `json:"is_external"`
}

Invitee represents meeting participant information

type Language

type Language struct {
	Locale string `json:"locale"`
}

type LocationField

type LocationField struct {
	Label    string        `json:"label"`
	Value    LocationValue `json:"value"`
	IsHidden bool          `json:"isHidden,omitempty"`
}

type LocationValue

type LocationValue struct {
	Value       string `json:"value"`
	OptionValue string `json:"optionValue"`
}

type Meeting

type Meeting struct {
	ExternalDomainsStr       string           `json:"external_domains"`
	ExternalDomains          []ExternalDomain `json:"external_domains_array"`
	HasExternalInvitees      string           `json:"has_external_invitees"`
	InviteesStr              string           `json:"invitees"`
	Invitees                 []Invitee        `json:"invitees_array"`
	JoinURL                  string           `json:"join_url"`
	ScheduledDurationMinutes string           `json:"scheduled_duration_in_minutes"`
	ScheduledEndTime         time.Time        `json:"scheduled_end_time"`
	ScheduledStartTime       time.Time        `json:"scheduled_start_time"`
	Title                    string           `json:"title"`
}

Meeting represents the meeting information

type Organizer

type Organizer struct {
	ID         int      `json:"id"`
	Name       string   `json:"name"`
	Email      string   `json:"email"`
	Username   string   `json:"username"`
	TimeZone   string   `json:"timeZone"`
	Language   Language `json:"language"`
	TimeFormat string   `json:"timeFormat"`
	UTCOffset  int      `json:"utcOffset"`
}

type PostmarkInboundEmailData

type PostmarkInboundEmailData struct {
	FromName      string `json:"FromName"`
	MessageStream string `json:"MessageStream"`
	From          string `json:"From"`
	FromFull      struct {
		Email       string `json:"Email"`
		Name        string `json:"Name"`
		MailboxHash string `json:"MailboxHash"`
	} `json:"FromFull"`
	To     string `json:"To"`
	ToFull []struct {
		Email       string `json:"Email"`
		Name        string `json:"Name"`
		MailboxHash string `json:"MailboxHash"`
	} `json:"ToFull"`
	Cc     string `json:"Cc"`
	CcFull []*struct {
		Email       string `json:"Email"`
		Name        string `json:"Name"`
		MailboxHash string `json:"MailboxHash"`
	} `json:"CcFull"`
	Bcc     string `json:"Bcc"`
	BccFull []*struct {
		Email       string `json:"Email"`
		Name        string `json:"Name"`
		MailboxHash string `json:"MailboxHash"`
	} `json:"BccFull"`
	OriginalRecipient string `json:"OriginalRecipient"`
	Subject           string `json:"Subject"`
	MessageID         string `json:"MessageID"`
	ReplyTo           string `json:"ReplyTo"`
	MailboxHash       string `json:"MailboxHash"`
	Date              string `json:"Date"`
	TextBody          string `json:"TextBody"`
	HtmlBody          string `json:"HtmlBody"`
	StrippedTextReply string `json:"StrippedTextReply"`
	Tag               string `json:"Tag"`
	Headers           []struct {
		Name  string `json:"Name"`
		Value string `json:"Value"`
	} `json:"Headers"`
	Attachments []struct {
		Name          string `json:"Name"`
		Content       string `json:"Content"`
		ContentType   string `json:"ContentType"`
		ContentLength int    `json:"ContentLength"`
	} `json:"Attachments"`
}

func (*PostmarkInboundEmailData) AllBccEmails

func (p *PostmarkInboundEmailData) AllBccEmails() []string

func (*PostmarkInboundEmailData) AllCcEmails

func (p *PostmarkInboundEmailData) AllCcEmails() []string

func (*PostmarkInboundEmailData) AllParticipantEmails

func (p *PostmarkInboundEmailData) AllParticipantEmails() []string

func (*PostmarkInboundEmailData) AllToEmails

func (p *PostmarkInboundEmailData) AllToEmails() []string

func (*PostmarkInboundEmailData) DMARCReportProvider

func (p *PostmarkInboundEmailData) DMARCReportProvider() string

func (*PostmarkInboundEmailData) EmailSentTimestamp

func (p *PostmarkInboundEmailData) EmailSentTimestamp() time.Time

func (*PostmarkInboundEmailData) GetHeaderValue

func (p *PostmarkInboundEmailData) GetHeaderValue(header string) string

func (*PostmarkInboundEmailData) GetHeaders

func (p *PostmarkInboundEmailData) GetHeaders() map[string]string

func (*PostmarkInboundEmailData) HTMLBody

func (p *PostmarkInboundEmailData) HTMLBody() string

func (*PostmarkInboundEmailData) HasAttachments

func (p *PostmarkInboundEmailData) HasAttachments() bool

func (*PostmarkInboundEmailData) IsMonitorEmail

func (p *PostmarkInboundEmailData) IsMonitorEmail() bool

func (*PostmarkInboundEmailData) TEXTBody

func (p *PostmarkInboundEmailData) TEXTBody() string

func (*PostmarkInboundEmailData) TenantFromBcc

func (p *PostmarkInboundEmailData) TenantFromBcc() string

func (*PostmarkInboundEmailData) ToRawDbObject

func (p *PostmarkInboundEmailData) ToRawDbObject() entity.EmailRawData

type Recording

type Recording struct {
	DurationInMinutes string `json:"duration_in_minutes"`
	ShareURL          string `json:"share_url"`
	URL               string `json:"url"`
}

Recording represents the recording information

type ResponseField

type ResponseField struct {
	Label    string `json:"label"`
	Value    string `json:"value"`
	IsHidden bool   `json:"isHidden,omitempty"`
}

type UserFieldsResponses

type UserFieldsResponses struct {
	PhoneNumber ResponseField `json:"phone-number"`
}

Jump to

Keyboard shortcuts

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