Documentation
¶
Overview ¶
Package email provides the email integration definition for the integrations framework. It supports dual-use: runtime-provisioned ("system owned") for internal platform email (password resets, invites, campaigns, workflow actions) and customer-provisioned for customer-managed email sending via resend, sendgrid, or postmark
Index ¶
- Constants
- Variables
- func AllEmailOperations() []types.OperationRegistration
- func Builder(cfg *RuntimeEmailConfig, devMode bool) registry.Builder
- func EmailScrubber() scrubber.Scrubber
- func MockSenderFromClient(client any) *mock.EmailSender
- func QuestionnaireAuthURL(ctx context.Context, db *generated.Client, ...) (string, error)
- func RenderCatalogPreview(ctx context.Context, client *Client, d Dispatcher, draft map[string]any) (string, error)
- func SetDefaultTrustCenterDomain(domain string)
- func TargetDispatchable(status enums.AssessmentResponseStatus, sentAt *models.DateTime, resend bool, ...) bool
- func TemplateVariables() []models.TemplateVariable
- func TestFixture(name, toEmail string, defaultBranding bool) json.RawMessage
- func TrustCenterSettingFixture() *generated.TrustCenterSetting
- func TrustCenterUpdateContent(req TrustCenterUpdateRequest) (map[string]any, error)
- type BillingEmailChangedEmail
- type BrandedMessageRequest
- type CampaignContext
- type CampaignDispatchInput
- type CampaignDispatchResult
- type Client
- type Credential
- type Dispatcher
- type HealthCheck
- type InviteJoinedRequest
- type InviteRequest
- type Operation
- func (e Operation[T]) BuilderUISchema() json.RawMessage
- func (e Operation[T]) ExamplePayload() json.RawMessage
- func (e Operation[T]) Name() string
- func (e Operation[T]) Registration() types.OperationRegistration
- func (e Operation[T]) RenderMessage(_ context.Context, client *Client, payload json.RawMessage, ...) (*newman.EmailMessage, error)
- func (e Operation[T]) SendByKey(ctx context.Context, req types.OperationRequest, client *Client, ...) error
- type OrgDeletionNoticeEmail
- type PasswordResetEmailRequest
- type PasswordResetSuccessRequest
- type QuestionnaireAuthEmail
- type Recipient
- type RecipientInfo
- type ResendDeliveryEvent
- type ResendWebhook
- type RuntimeEmailConfig
- type SendBrandedCampaign
- type SendBrandedCampaignRequest
- type SendEmail
- type SendEmailRequest
- type SendQuestionnaireCampaign
- type SendQuestionnaireCampaignRequest
- type SocialLink
- type SubprocessorEntry
- type SubprocessorNotificationRequest
- type SubscribeRequest
- type TargetSendFunc
- type TrustCenterAuthEmail
- type TrustCenterBranding
- type TrustCenterNDAApprovalRequestEmail
- type TrustCenterNDARequestEmail
- type TrustCenterNDASignedEmail
- type TrustCenterUpdateRequest
- type UserInput
- type VerifyBillingRequest
- type VerifyEmailRequest
- type WelcomeRequest
Constants ¶
const ( // TagCampaignTargetID identifies the campaign target for delivery event correlation TagCampaignTargetID = "campaign_target_id" // TagAssessmentResponseID identifies the assessment response for delivery event correlation TagAssessmentResponseID = "assessment_response_id" // TagIsTest marks a message as a test send to prevent cascade updates TagIsTest = "is_test" )
Tag key constants for email delivery tracking via provider webhooks
const DefaultTrustCenterUpdateTitle = "Trust center update"
DefaultTrustCenterUpdateTitle backs the post notification subject and post heading when the post has no title and the trust center branding carries no company name
const ( // MetadataUnsubscribeTokenKey is the campaign target metadata key under which the trust center // subscriber snapshot stores the per-recipient unsubscribe token consumed at render time MetadataUnsubscribeTokenKey = "unsubscribeToken" )
const ProviderMock = "mock"
ProviderMock is the provider name for the mock email sender used in tests
const TrustCenterUpdateTemplate = "tmpl_trustcenter_update"
TrustCenterUpdateTemplate is the dispatcher registration key for the trust center post notification; trust center update campaigns render through it directly with no linked email template
Variables ¶
var ( // ErrProviderNotSupported indicates the provider string is not a recognized email provider ErrProviderNotSupported = errors.New("email: provider not supported") // ErrClientBuildFailed indicates the email client could not be constructed ErrClientBuildFailed = errors.New("email: client build failed") // ErrDispatcherNotFound indicates no registered email dispatcher matches the template key ErrDispatcherNotFound = errors.New("email: dispatcher not found for template key") // ErrInvalidOperationClient indicates the operation request client is not the expected *Client type ErrInvalidOperationClient = errors.New("email: invalid operation client type") // ErrTemplateRenderFailed indicates template rendering failed ErrTemplateRenderFailed = errors.New("email: template render failed") // ErrSendFailed indicates the email provider returned an error during send ErrSendFailed = errors.New("email: send failed") // ErrEmailTemplateNotFound indicates an email template cannot be found ErrEmailTemplateNotFound = errors.New("email: email template not found") // ErrCampaignNotFound indicates a campaign cannot be found for email dispatch ErrCampaignNotFound = errors.New("email: campaign not found") // ErrSenderNotConfigured indicates the email client has no sender configured ErrSenderNotConfigured = errors.New("email: sender not configured") // ErrCampaignMissingAssessment indicates a questionnaire campaign has no linked assessment ErrCampaignMissingAssessment = errors.New("email: campaign has no assessment ID") // ErrAssessmentNotFound indicates the assessment linked to a campaign cannot be found ErrAssessmentNotFound = errors.New("email: assessment not found") // ErrQuestionnaireDispatchFailed indicates failure during dispatch of a questionnaire access email to a campaign target ErrQuestionnaireDispatchFailed = errors.New("email: questionnaire dispatch failed") // ErrWebhookSecretMissing indicates the Resend webhook signing secret is not configured ErrWebhookSecretMissing = errors.New("email: webhook secret missing") // ErrWebhookPayloadInvalid indicates the inbound webhook payload could not be decoded ErrWebhookPayloadInvalid = errors.New("email: webhook payload invalid") // ErrWebhookMissingID indicates the svix-id header is absent from the webhook request ErrWebhookMissingID = errors.New("email: webhook missing svix-id header") // ErrMissingURLResolutionFields indicates a PreHook cannot resolve a URL because required fields are empty ErrMissingURLResolutionFields = errors.New("email: missing required fields for URL resolution") )
var (
_, VerifyEmailOp = providerkit.OperationSchema[VerifyEmailRequest]()
_,//nolint:revive
WelcomeOp = providerkit.OperationSchema[WelcomeRequest]()
_,//nolint:revive
InviteOp = providerkit.OperationSchema[InviteRequest]()
_,//nolint:revive
InviteJoinedOp = providerkit.OperationSchema[InviteJoinedRequest]()
_,//nolint:revive
ResetRequestOp = providerkit.OperationSchema[PasswordResetEmailRequest]()
_,//nolint:revive
ResetSuccessOp = providerkit.OperationSchema[PasswordResetSuccessRequest]()
_,//nolint:revive
SubscribeOp = providerkit.OperationSchema[SubscribeRequest]()
_,//nolint:revive
VerifyBillingOp = providerkit.OperationSchema[VerifyBillingRequest]()
_,//nolint:revive
TCNDARequestOp = providerkit.OperationSchema[TrustCenterNDARequestEmail]()
_,//nolint:revive
TCNDASignedOp = providerkit.OperationSchema[TrustCenterNDASignedEmail]()
_,//nolint:revive
TCAuthOp = providerkit.OperationSchema[TrustCenterAuthEmail]()
_,//nolint:revive
QuestionnaireAuthOp = providerkit.OperationSchema[QuestionnaireAuthEmail]()
_,//nolint:revive
BillingEmailChangedOp = providerkit.OperationSchema[BillingEmailChangedEmail]()
_,//nolint:revive
OrgDeletionNoticeOp = providerkit.OperationSchema[OrgDeletionNoticeEmail]()
_,//nolint:revive
TCNDAApprovalRequestOp = providerkit.OperationSchema[TrustCenterNDAApprovalRequestEmail]() //nolint:revive
)
var ( // DefinitionID is the stable identifier for the email integration definition DefinitionID = types.NewDefinitionRef("def_01EMAILINT00000000000000001") _,// sendEmailSchema is the operation schema for the generic send-email operation SendEmailOp = providerkit.OperationSchema[SendEmailRequest]() _,//nolint:revive // sendBrandedCampaignSchema is the operation schema for the branded campaign dispatch operation SendCampaignOp = providerkit.OperationSchema[SendBrandedCampaignRequest]() _,//nolint:revive // sendQuestionnaireCampaignSchema is the operation schema for the questionnaire campaign dispatch operation SendQuestionnaireCampaignOp = providerkit.OperationSchema[SendQuestionnaireCampaignRequest]() //nolint:revive )
var DefaultSocial = []SocialLink{
{Platform: "Openlane", IconURL: "https://www.theopenlane.io/cdn-cgi/imagedelivery/2gi-D0CFOlSOflWJG-LQaA/2c681874-6b4a-41de-73ea-58e550a95800/w=36", URL: "https://www.theopenlane.io"},
{Platform: "GitHub", IconURL: "https://www.theopenlane.io/cdn-cgi/imagedelivery/2gi-D0CFOlSOflWJG-LQaA/39a11dc8-8e01-44ed-8557-0b78ae050a00/w=36", URL: "https://github.com/theopenlane"},
{Platform: "LinkedIn", IconURL: "https://www.theopenlane.io/cdn-cgi/imagedelivery/2gi-D0CFOlSOflWJG-LQaA/e9c20fd9-c8a6-4f79-9267-41f491746c00/w=36", URL: "https://linkedin.com/company/theopenlane"},
{Platform: "Discord", IconURL: "https://www.theopenlane.io/cdn-cgi/imagedelivery/2gi-D0CFOlSOflWJG-LQaA/1fba759d-6580-49d8-daee-a82034226b00/w=36", URL: "https://discord.gg/4fq2sxDk7D"},
}
DefaultSocial is the default set of social footer links applied to runtime email configs when no explicit social links are provided
var EmailHTMLScrubber = scrubber.NewPolicyScrubber(scrubber.WithEmailDefaults())
EmailHTMLScrubber is the shared scrubber instance used by email providers for render-time HTML sanitization, preserving email-safe layout elements while stripping dangerous content
var ( // TrustCenterUpdateOp is the typed operation ref for the trust center post notification TrustCenterUpdateOp = types.NewOperationRef[TrustCenterUpdateRequest](TrustCenterUpdateTemplate) )
trustCenterUpdateSchema is the reflected JSON schema for the trust center update input type and TrustCenterUpdateOp is the typed operation ref registered under the durable template key
var (
_, BrandedMessageOp = providerkit.OperationSchema[BrandedMessageRequest]() //nolint:revive
)
brandedMessageSchema is the reflected JSON schema for the branded message input type and BrandedMessageOp is the typed operation ref used for catalog dispatch
var (
_, SubprocessorNotificationOp = providerkit.OperationSchema[SubprocessorNotificationRequest]() //nolint:revive
)
subprocessorNotificationSchema is the reflected JSON schema for the subprocessor notification input type and SubprocessorNotificationOp is the typed operation ref used for catalog dispatch
Functions ¶
func AllEmailOperations ¶
func AllEmailOperations() []types.OperationRegistration
AllEmailOperations returns all system email operation registrations for wiring into the builder
func Builder ¶
func Builder(cfg *RuntimeEmailConfig, devMode bool) registry.Builder
Builder returns the email definition builder with the supplied runtime config applied. When devMode is true or cfg.Provisioned() returns true, a RuntimeIntegration is included for system-send. In dev mode the sender writes MIME files to cfg.TestDir instead of calling the provider API. Customer registrations (credentials, connections, clients, user input) are always present
func EmailScrubber ¶
EmailScrubber returns the shared HTML scrubber instance used for email content sanitization. This is the canonical sanitization policy for both storage-time and render-time email HTML processing
func MockSenderFromClient ¶
func MockSenderFromClient(client any) *mock.EmailSender
MockSenderFromClient extracts the *mock.EmailSender from an Client. Returns nil if the sender is not a mock
func QuestionnaireAuthURL ¶ added in v1.21.5
func QuestionnaireAuthURL(ctx context.Context, db *generated.Client, assessmentID, ownerID, recipientEmail string) (string, error)
QuestionnaireAuthURL generates an anonymous access token URL for questionnaire access
func RenderCatalogPreview ¶ added in v1.23.5
func RenderCatalogPreview(ctx context.Context, client *Client, d Dispatcher, draft map[string]any) (string, error)
RenderCatalogPreview renders a customer-selectable catalog entry to HTML for UI preview. The dispatcher example is the base layer and draft holds the in-progress form values that override it, so fields the author has not yet filled in still render with demo content
func SetDefaultTrustCenterDomain ¶
func SetDefaultTrustCenterDomain(domain string)
SetDefaultTrustCenterDomain sets the fallback domain for trust center URLs
func TargetDispatchable ¶
func TargetDispatchable(status enums.AssessmentResponseStatus, sentAt *models.DateTime, resend bool, includeOverdue bool) bool
TargetDispatchable reports whether a campaign target should be included in a dispatch attempt for the requested action semantics
func TemplateVariables ¶
func TemplateVariables() []models.TemplateVariable
TemplateVariables returns all system-provided template variables available to email template authors: config-backed fields, payload fields, and computed values
func TestFixture ¶
func TestFixture(name, toEmail string, defaultBranding bool) json.RawMessage
TestFixture returns a scaffolded JSON payload for the given dispatcher name. All required fields are populated with realistic test values; URL-resolved fields (NDAURL, AuthURL) are set directly so PreHooks that require a database are bypassed. When defaultBranding is true, the trust center branding overlay is stripped from trust-center emails so they render with the Openlane system defaults (the fallback used when a trust center configures no branding), letting both branding variants be previewed. Returns nil when no fixture is defined
func TrustCenterSettingFixture ¶ added in v1.24.0
func TrustCenterSettingFixture() *generated.TrustCenterSetting
TrustCenterSettingFixture returns a sample trust center setting with branding populated, used to preview and test what a trust center update email looks like with customer branding applied
func TrustCenterUpdateContent ¶ added in v1.27.7
func TrustCenterUpdateContent(req TrustCenterUpdateRequest) (map[string]any, error)
TrustCenterUpdateContent converts the update request to the campaign metadata map persisted on automated trust center update campaigns and rendered per recipient at send time. Recipient fields are per-target, so the empty recipient email key is dropped from the stored content
Types ¶
type BillingEmailChangedEmail ¶
type BillingEmailChangedEmail struct {
RecipientInfo
// OrgName is the organization whose billing email changed
OrgName string `json:"org_name" jsonschema:"required,description=Organization name"`
// OldBillingEmail is the previous billing email address
OldBillingEmail string `json:"old_billing_email" jsonschema:"required,description=Previous billing email"`
// NewBillingEmail is the new billing email address
NewBillingEmail string `json:"new_billing_email" jsonschema:"required,description=New billing email"`
// ChangedAt is the timestamp of the change
ChangedAt time.Time `json:"changed_at" jsonschema:"required,description=Timestamp of the change"`
}
BillingEmailChangedEmail is the input for the billing email change notification
type BrandedMessageRequest ¶
type BrandedMessageRequest struct {
// RecipientInfo and CampaignContext are populated per-send (campaign target and
// dispatch context), not authored in the template, so they are excluded from the
// reflected catalog config schema via jsonschema:"-". Their JSON tags are untouched
// so the dispatch payload still carries them
RecipientInfo `jsonschema:"-"`
CampaignContext `jsonschema:"-"`
// Subject is the email subject line
Subject string `json:"subject" jsonschema:"required,description=Email subject line"`
// Preheader is hidden preview text shown in the inbox list
Preheader string `json:"preheader,omitempty" jsonschema:"description=Inbox preview text"`
// Title is the headline shown above the body paragraphs
Title string `json:"title" jsonschema:"required,description=Email headline"`
// Intros are body paragraphs rendered before the optional call-to-action button
Intros []string `json:"intros,omitempty" jsonschema:"description=Body paragraphs rendered before the call-to-action"`
// ButtonText is the optional call-to-action button label
ButtonText string `json:"buttonText,omitempty" jsonschema:"description=Call-to-action button label"`
// ButtonLink is the URL the call-to-action button navigates to
ButtonLink string `json:"buttonLink,omitempty" jsonschema:"format=uri,description=Call-to-action button URL"`
// Outros are fine-print paragraphs rendered after the call-to-action
Outros []string `json:"outros,omitempty" jsonschema:"description=Fine-print paragraphs rendered after the call-to-action"`
// LogoURL overrides the hero logo displayed in the email body for this send
LogoURL string `json:"logoURL,omitempty" jsonschema:"format=uri,description=Hero logo URL override for this send"`
// HeaderLogoURL overrides the small logo/icon in the top header bar for this send
HeaderLogoURL string `json:"headerLogoURL,omitempty" jsonschema:"format=uri,description=Header bar logo/icon URL override for this send"`
// PrimaryColor overrides the headline/emphasis color for this send
PrimaryColor string `json:"primaryColor,omitempty" jsonschema:"format=color,description=Primary headline color override (hex)"`
// BodyBackgroundColor overrides the outer page background color for this send
BodyBackgroundColor string `json:"bodyBackgroundColor,omitempty" jsonschema:"format=color,description=Outer page background color override (hex)"`
// CardBackgroundColor overrides the card container background color for this send
CardBackgroundColor string `json:"cardBackgroundColor,omitempty" jsonschema:"format=color,description=Card container background color override (hex)"`
// HeroBackgroundColor overrides the hero banner background color for this send
HeroBackgroundColor string `json:"heroBackgroundColor,omitempty" jsonschema:"format=color,description=Hero banner background color override (hex)"`
// ButtonColor overrides the call-to-action button background color for this send
ButtonColor string `json:"buttonColor,omitempty" jsonschema:"format=color,description=CTA button background color override (hex)"`
// ButtonTextColor overrides the call-to-action button text color for this send
ButtonTextColor string `json:"buttonTextColor,omitempty" jsonschema:"format=color,description=CTA button text color override (hex)"`
// TextColor overrides the body paragraph text color for this send
TextColor string `json:"textColor,omitempty" jsonschema:"format=color,description=Body text color override (hex)"`
FooterTextColor string `json:"footerTextColor,omitempty" jsonschema:"format=color,description=Muted text color override (hex)"`
// CompanyName is the company display name shown in the footer; customer-supplied
// because a branded message carries the customer's own identity rather than Openlane's
CompanyName string `json:"companyName,omitempty" jsonschema:"description=Company display name shown in the footer"`
// Corporation is the legal corporation name used in the footer copyright notice
Corporation string `json:"corporation,omitempty" jsonschema:"description=Legal corporation name used in the footer copyright notice"`
// CompanyAddress is the mailing address shown in the footer
CompanyAddress string `json:"companyAddress,omitempty" jsonschema:"description=Company mailing address shown in the footer"`
// Copyright overrides the footer copyright line; when empty the template renders a notice from Corporation and the current year
Copyright string `` /* 144-byte string literal not displayed */
// Tagline is a short descriptive footer line rendered above the social row
Tagline string `json:"tagline,omitempty" jsonschema:"description=Short descriptive footer line rendered above the social row"`
// TermsURL is the terms of service link shown in the footer
TermsURL string `json:"termsURL,omitempty" jsonschema:"format=uri,description=Terms of service link shown in the footer"`
// PrivacyURL is the privacy policy link shown in the footer
PrivacyURL string `json:"privacyURL,omitempty" jsonschema:"format=uri,description=Privacy policy link shown in the footer"`
// UnsubscribeURL is the unsubscribe link shown in the footer
UnsubscribeURL string `json:"unsubscribeURL,omitempty" jsonschema:"format=uri,description=Unsubscribe link shown in the footer"`
// Social is the ordered list of social footer entries rendered beneath the body
Social []SocialLink `json:"social,omitempty" jsonschema:"description=Social footer links rendered beneath the body"`
}
BrandedMessageRequest is a customer-selectable catalog entry providing a flexible, brand-themed email shape. Customers supply the subject, headline, body paragraphs, and optional call-to-action; the base theme handles layout, branding, and footer chrome
type CampaignContext ¶
type CampaignContext struct {
// CampaignID is the identifier of the campaign producing the send
CampaignID string `json:"campaignId,omitempty" jsonschema:"description=Campaign identifier"`
// CampaignName is the display name of the campaign
CampaignName string `json:"campaignName,omitempty" jsonschema:"description=Campaign display name"`
// CampaignDescription is the long-form description of the campaign
CampaignDescription string `json:"campaignDescription,omitempty" jsonschema:"description=Campaign description"`
// CampaignDueDate is the response deadline for the campaign, formatted for display
CampaignDueDate string `json:"campaignDueDate,omitempty" jsonschema:"description=Campaign response due date"`
}
CampaignContext carries campaign-scoped metadata for catalog entries that render campaign-bound emails. Entries that need campaign fields embed this struct in their input type; the campaign dispatcher populates the JSON overlay before calling SendByKey
type CampaignDispatchInput ¶
type CampaignDispatchInput struct {
// CampaignID is the identifier of the campaign to dispatch
CampaignID string `json:"campaignId" jsonschema:"required,description=Campaign identifier"`
// Resend allows previously sent, incomplete targets to receive another message
Resend bool `json:"resend,omitempty" jsonschema:"description=Whether to include previously sent targets"`
// IncludeOverdue includes overdue targets when dispatching incomplete recipients
IncludeOverdue bool `json:"includeOverdue,omitempty" jsonschema:"description=Whether overdue targets should be included"`
}
CampaignDispatchInput holds the shared dispatch parameters for campaign operations
type CampaignDispatchResult ¶
type CampaignDispatchResult struct {
// SentCount is the number of messages successfully sent
SentCount int `json:"sentCount"`
// SkippedCount is the number of targets skipped (already sent, completed, filtered)
SkippedCount int `json:"skippedCount"`
// FailedCount is the number of targets that failed to render or send
FailedCount int `json:"failedCount"`
}
CampaignDispatchResult is the structured result returned by campaign operations
type Client ¶
type Client struct {
// Sender is the configured email provider client
Sender newman.EmailSender
// Config holds branding and URL configuration for template rendering
Config RuntimeEmailConfig
}
Client wraps a newman.EmailSender with the RuntimeEmailConfig needed for template rendering and branding
type Credential ¶
type Credential struct {
// APIKey is the email provider API key
APIKey string `json:"apiKey" jsonschema:"required,description=Email provider API key"`
// Provider is the email service provider name
Provider string `json:"provider" jsonschema:"required,enum=resend,enum=sendgrid,enum=postmark,description=Email service provider"`
}
Credential is the credential schema for customer-provisioned email
type Dispatcher ¶
type Dispatcher interface {
// Name returns the catalog key identifying the dispatcher
Name() string
// Registration returns the integration operation registration for this entry
Registration() types.OperationRegistration
// SendByKey decodes the payload into the entry's typed input, runs any registered PreHook,
// and dispatches through the shared render/send pipeline. Additional newman options are
// appended after the operation's own MessageOptions
SendByKey(ctx context.Context, req types.OperationRequest, client *Client, payload json.RawMessage, extraOpts ...newman.MessageOption) error
// RenderMessage decodes the payload and renders the email into a newman message without sending it, for use in batch send paths
RenderMessage(ctx context.Context, client *Client, payload json.RawMessage, extraOpts ...newman.MessageOption) (*newman.EmailMessage, error)
// ExamplePayload returns a representative example payload used to render catalog previews and to seed the form preview with demo values
ExamplePayload() json.RawMessage
// BuilderUISchema returns the RJSF-style UI schema describing how the configurable fields render as a form, or nil when none is defined
BuilderUISchema() json.RawMessage
}
Dispatcher describes a catalog-addressable email operation that can be invoked by key The implementation owns typed decoding of the payload and projection into render.EmailContent; callers supply a raw JSON payload whose shape matches the registered input type
func CustomerSelectableDispatchers ¶
func CustomerSelectableDispatchers() []Dispatcher
CustomerSelectableDispatchers returns the dispatchers explicitly marked as customer-selectable
func DispatcherByKey ¶
func DispatcherByKey(key string) (Dispatcher, bool)
DispatcherByKey resolves a registered email dispatcher by its catalog key
type HealthCheck ¶
type HealthCheck struct{}
HealthCheck validates that the email provider credentials are functional by verifying the sender is configured and reachable
func (HealthCheck) Handle ¶
func (h HealthCheck) Handle() types.OperationHandler
Handle returns the typed operation handler for builder registration
func (HealthCheck) Run ¶
func (HealthCheck) Run(_ context.Context, client *Client) (json.RawMessage, error)
Run validates the email client is configured with a working sender
type InviteJoinedRequest ¶
type InviteJoinedRequest struct {
RecipientInfo
// OrgName is the organization the user joined
OrgName string `json:"org_name" jsonschema:"required,description=Organization name"`
}
InviteJoinedRequest is the input for the invite-accepted notification
type InviteRequest ¶
type InviteRequest struct {
RecipientInfo
// InviterName is the name of the person who sent the invite
InviterName string `json:"inviter_name" jsonschema:"required,description=Name of the person sending the invite"`
// OrgName is the organization being invited to
OrgName string `json:"org_name" jsonschema:"required,description=Organization name"`
// Role is the invited role
Role string `json:"role,omitempty" jsonschema:"description=Invited role"`
// Token is the invite token appended to the invite URL
Token string `json:"token" jsonschema:"required,description=Invite token"`
// NewUser indicates the recipient has no existing account
NewUser bool `json:"newUser,omitempty" jsonschema:"description=Whether the recipient has no existing account"`
}
InviteRequest is the input for the organization invite operation
type Operation ¶
type Operation[T Recipient] struct { // Op is the typed operation ref with name derived from the schema definition key Op types.OperationRef[T] // Schema is the reflected JSON schema for the input type Schema json.RawMessage // Description is the human-readable summary shown in the catalog picker Description string // CustomerSelectable gates whether the entry is exposed via the customer-facing catalog query CustomerSelectable *bool // Example is a representative input used to render catalog previews and to seed the // form preview with demo values for fields the author has not yet filled in Example T // UISchema is the RJSF-style UI schema describing how the configurable fields render as a form UISchema json.RawMessage // Subject returns the rendered subject line for the email Subject func(cfg RuntimeEmailConfig, input T) string // Theme is the newman render theme applied to this email Theme *render.Theme // Build returns the structured body content for newman rendering Build func(cfg RuntimeEmailConfig, input T) render.ContentBody // Config is an optional per-op override for the installation config Config func(cfg RuntimeEmailConfig, input T) RuntimeEmailConfig // MessageOptions returns additional newman message options for per-operation customization such as attachment MessageOptions func(cfg RuntimeEmailConfig, input T) []newman.MessageOption // PreHook is an optional hook invoked before rendering to resolve dynamic fields PreHook func(ctx context.Context, req types.OperationRequest, input *T) error }
Operation is a generic helper which defines a single system email type as a registered integration operation this allows us to do AllEmailOperations() in the builder rather than manually wiring each
func RegisterEmailOperation ¶
RegisterEmailOperation constructs an Operation[T] and adds it to the dispatcher registry
func (Operation[T]) BuilderUISchema ¶ added in v1.23.5
func (e Operation[T]) BuilderUISchema() json.RawMessage
BuilderUISchema returns the UI schema for the operation, satisfying the Dispatcher interface
func (Operation[T]) ExamplePayload ¶ added in v1.23.5
func (e Operation[T]) ExamplePayload() json.RawMessage
ExamplePayload returns the marshaled example input, satisfying the Dispatcher interface
func (Operation[T]) Name ¶
Name returns the catalog key for the operation, satisfying the Dispatcher interface
func (Operation[T]) Registration ¶
func (e Operation[T]) Registration() types.OperationRegistration
Registration returns the types.OperationRegistration for wiring into the definition builder. Catalog-facing fields (Description, CustomerSelectable) travel on the registration so downstream filters (e.g. customer-facing catalog query) can operate on AllEmailOperations directly
func (Operation[T]) RenderMessage ¶
func (e Operation[T]) RenderMessage(_ context.Context, client *Client, payload json.RawMessage, extraOpts ...newman.MessageOption) (*newman.EmailMessage, error)
RenderMessage decodes the payload and renders the email into a newman message without sending it
func (Operation[T]) SendByKey ¶
func (e Operation[T]) SendByKey(ctx context.Context, req types.OperationRequest, client *Client, payload json.RawMessage, extraOpts ...newman.MessageOption) error
SendByKey decodes the payload into T and dispatches through the shared render pipeline
type OrgDeletionNoticeEmail ¶ added in v1.21.0
type OrgDeletionNoticeEmail struct {
RecipientInfo
// OrgName is the name of the organization scheduled for deletion
OrgName string `json:"org_name" jsonschema:"required,description=Organization name"`
// DeletionDate is the date the organization will be deleted
DeletionDate time.Time `json:"deletion_date" jsonschema:"required,description=Scheduled deletion date"`
}
OrgDeletionNoticeEmail is the input for the organization deletion notice operation
type PasswordResetEmailRequest ¶
type PasswordResetEmailRequest struct {
RecipientInfo
// Token is the password reset token appended to the reset URL
Token string `json:"token" jsonschema:"required,description=Password reset token"`
}
PasswordResetEmailRequest is the input for the password reset request operation
type PasswordResetSuccessRequest ¶
type PasswordResetSuccessRequest struct {
RecipientInfo
}
PasswordResetSuccessRequest is the input for the password reset confirmation operation
type QuestionnaireAuthEmail ¶
type QuestionnaireAuthEmail struct {
RecipientInfo
// OrgName is the name of the organization sending the questionnaire; resolved from auth context when empty
OrgName string `json:"org_name,omitempty" jsonschema:"description=Organization name"`
// AssessmentName is the name of the assessment/questionnaire
AssessmentName string `json:"assessment_name" jsonschema:"required,description=Assessment name"`
// AuthURL is the authentication URL for questionnaire access
AuthURL string `json:"auth_url" jsonschema:"required,description=Questionnaire auth URL"`
}
QuestionnaireAuthEmail is the input for questionnaire access authentication
type Recipient ¶
type Recipient interface {
// GetRecipient returns the RecipientInfo
GetRecipient() RecipientInfo
}
Recipient is implemented by all email operation input types to provide recipient information
type RecipientInfo ¶
type RecipientInfo struct {
// Email is the recipient email address; it is the primary recipient used for personalization and footer links
Email string `json:"email" jsonschema:"required,description=Recipient email address"`
// Recipients optionally addresses the message to multiple recipients in a single send; when set it replaces Email as the To list
Recipients []string `` /* 155-byte string literal not displayed */
// FirstName is the recipient first name
FirstName string `json:"firstName,omitempty" jsonschema:"description=Recipient first name"`
// LastName is the recipient last name
LastName string `json:"lastName,omitempty" jsonschema:"description=Recipient last name"`
// UnsubscribeToken is the per-recipient token used to build an unsubscribe link in templates
// via {{ .unsubscribeToken }}; it is populated per send and never authored in the template
UnsubscribeToken string `json:"unsubscribeToken,omitempty" jsonschema:"description=Per-recipient unsubscribe token"`
// Tags are delivery tracking tags forwarded to the email provider for webhook correlation
Tags []newman.Tag `json:"tags,omitempty" jsonschema:"description=Delivery tracking tags"`
}
RecipientInfo holds recipient addressing fields embedded in every email operation input
func TestRecipient ¶
func TestRecipient(toEmail string) RecipientInfo
TestRecipient returns a RecipientInfo with the given email and placeholder name fields
func (RecipientInfo) GetRecipient ¶
func (r RecipientInfo) GetRecipient() RecipientInfo
GetRecipient returns the recipient info, satisfying the Recipient interface
type ResendDeliveryEvent ¶ added in v1.21.0
type ResendDeliveryEvent struct{}
ResendDeliveryEvent handles email delivery status updates from Resend
func (ResendDeliveryEvent) Handle ¶ added in v1.21.0
func (ResendDeliveryEvent) Handle(ctx context.Context, req types.WebhookHandleRequest) error
Handle processes one Resend delivery event by updating the relevant campaign target and assessment response records
type ResendWebhook ¶ added in v1.21.0
type ResendWebhook struct {
// Secret is the Svix signing secret used to verify inbound webhook payloads
Secret string
}
ResendWebhook implements verification and event resolution for inbound Resend webhooks
func (ResendWebhook) Event ¶ added in v1.21.0
func (ResendWebhook) Event(req types.WebhookInboundRequest) (types.WebhookReceivedEvent, error)
Event resolves an inbound Resend webhook payload into a registered event
func (ResendWebhook) Verify ¶ added in v1.21.0
func (w ResendWebhook) Verify(req types.WebhookInboundRequest) error
Verify authenticates an inbound Resend webhook using Svix signature verification
type RuntimeEmailConfig ¶
type RuntimeEmailConfig struct {
// TestDir is the directory where dev-mode email files are written
TestDir string `` /* 126-byte string literal not displayed */
// ResendSecret is the Resend webhook signing secret for verifying inbound delivery events
ResendSecret string `json:"resendsecret,omitempty" koanf:"resendsecret" jsonschema:"description=Resend webhook signing secret" sensitive:"true"`
// APIKey is the email provider API key
APIKey string `json:"apikey" koanf:"apikey" jsonschema:"required,description=Email provider API key" sensitive:"true"`
// Provider is the email service provider name (resend, sendgrid, postmark)
Provider string `json:"provider" koanf:"provider" jsonschema:"required,enum=resend,description=Email service provider" default:"resend"`
// FromEmail is the default sender email address
FromEmail string `` /* 127-byte string literal not displayed */
// SupportEmail is the support contact email address
SupportEmail string `` /* 128-byte string literal not displayed */
// QuestionnaireEmail is an optional sender override for questionnaire auth emails
QuestionnaireEmail string `` /* 171-byte string literal not displayed */
// RootURL is the root application URL used to construct email action links
RootURL string `` /* 150-byte string literal not displayed */
// ProductURL is the product home URL
ProductURL string `json:"producturl" koanf:"producturl" jsonschema:"description=Product home URL" default:"https://console.theopenlane.io"`
// DocsURL is the documentation URL
DocsURL string `json:"docsurl" koanf:"docsurl" jsonschema:"description=Documentation URL" default:"https://docs.theopenlane.io"`
// APIURL is the public base URL of this API, used for email links that must hit the API directly
// (rather than the console), e.g. the subscriber verify link that confirms then redirects to the trust center
APIURL string `` /* 159-byte string literal not displayed */
// CompanyName is the display name of the sending company
CompanyName string `json:"companyName" jsonschema:"description=Company display name" default:"Openlane"`
// CompanyAddress is the mailing address of the company
CompanyAddress string `json:"companyAddress" jsonschema:"description=Company mailing address" default:""`
// Corporation is the legal corporation name
Corporation string `json:"corporation" jsonschema:"description=Legal corporation name" default:"theopenlane, Inc."`
// LogoURL is the hero logo image URL displayed prominently in the email body
LogoURL string `json:"logoURL,omitempty" jsonschema:"description=Hero logo URL displayed in the email body"`
// HeaderLogoURL is the small logo/icon displayed in the top header bar
HeaderLogoURL string `` /* 243-byte string literal not displayed */
// Copyright is an optional copyright override for email footers; when empty the template renders © {year} {corporation}
Copyright string `` /* 176-byte string literal not displayed */
// TroubleText is the fallback help text shown below action buttons; {ACTION} is replaced with button text at render time
TroubleText string `` /* 271-byte string literal not displayed */
// TermsURL is the terms of service link for email footers
TermsURL string `` /* 150-byte string literal not displayed */
// PrivacyURL is the privacy policy link for email footers
PrivacyURL string `` /* 141-byte string literal not displayed */
// UnsubscribeURL is an optional unsubscribe link override for email footers; when empty the template constructs one from ProductURL and the recipient email
UnsubscribeURL string `` /* 180-byte string literal not displayed */
// HeaderText is the optional text displayed in the upper-right corner of the modern theme header row
HeaderText string `json:"headerText,omitempty" jsonschema:"description=Text displayed in the upper-right corner of the modern theme header"`
// CardStyle controls the card visual style; elevated adds rounded corners and a drop shadow
CardStyle string `json:"cardStyle,omitempty" jsonschema:"enum=flat,enum=elevated,description=Card visual style" default:"elevated"`
// BodyBackgroundColor is the outer page background color
BodyBackgroundColor string `json:"bodyBackgroundColor,omitempty" jsonschema:"description=Outer page background color" default:"#e8eaed"`
// CardBackgroundColor is the card container background color
CardBackgroundColor string `json:"cardBackgroundColor,omitempty" jsonschema:"description=Card container background color" default:"#ffffff"`
// HeroBackgroundColor is the hero banner section background color
HeroBackgroundColor string `json:"heroBackgroundColor,omitempty" jsonschema:"description=Hero banner section background color" default:"#f3f4f6"`
// ButtonColor is the call-to-action button background color
ButtonColor string `json:"buttonColor,omitempty" jsonschema:"description=Call-to-action button background color" default:"#14171e"`
// ButtonTextColor is the call-to-action button text color
ButtonTextColor string `json:"buttonTextColor,omitempty" jsonschema:"description=Call-to-action button text color" default:"#ffffff"`
// HeadingColor is the heading and title text color
HeadingColor string `json:"headingColor,omitempty" jsonschema:"description=Heading and title text color" default:"#14171e"`
// TextColor is the body paragraph text color
TextColor string `json:"textColor,omitempty" jsonschema:"description=Body paragraph text color" default:"#43454b"`
FooterTextColor string `` /* 134-byte string literal not displayed */
// AccentBorderColor is an optional decorative accent applied to borders only (e.g. the card top
// bar and callout edge); it never drives container, text, or button colors
AccentBorderColor string `json:"accentBorderColor,omitempty" jsonschema:"description=Decorative accent color applied to borders only"`
// Tagline is a short descriptive footer line rendered in modern themes above the social row
Tagline string `` /* 126-byte string literal not displayed */
// Social is the ordered list of social footer entries rendered by modern themes
Social []SocialLink `json:"social,omitempty" jsonschema:"-"`
}
RuntimeEmailConfig is the complete config for runtime-provisioned email. Operational fields (API key, provider, URLs) are sourced from koanf/environment at startup. Branding and presentation fields carry struct-tag defaults only and are overridable per-send via UserInput or per-operation Config functions
func MockRuntimeConfig ¶
func MockRuntimeConfig() *RuntimeEmailConfig
MockRuntimeConfig returns a RuntimeEmailConfig backed by the mock provider for use in integration test suites
func (RuntimeEmailConfig) Provisioned ¶
func (c RuntimeEmailConfig) Provisioned() bool
Provisioned reports whether the runtime config has the minimum required fields to build a working email client (API key, provider, and from address)
type SendBrandedCampaign ¶
type SendBrandedCampaign struct{}
SendBrandedCampaign dispatches templated branded emails to all pending campaign targets
func (SendBrandedCampaign) Handle ¶
func (s SendBrandedCampaign) Handle() types.OperationHandler
Handle returns the typed operation handler for builder registration
func (SendBrandedCampaign) Run ¶
func (SendBrandedCampaign) Run(ctx context.Context, req types.OperationRequest, client *Client, cfg SendBrandedCampaignRequest) (json.RawMessage, error)
Run loads the campaign and pending targets, renders all messages, then sends via batch API or rate-limited individual sends depending on whether attachments are present. Returns a marshaled CampaignDispatchResult with counts
type SendBrandedCampaignRequest ¶
type SendBrandedCampaignRequest struct {
CampaignDispatchInput
}
SendBrandedCampaignRequest is the operation config for dispatching a branded email campaign
type SendEmail ¶
type SendEmail struct{}
SendEmail dispatches a single templated email through the resolved email client
func (SendEmail) Handle ¶
func (s SendEmail) Handle() types.OperationHandler
Handle returns the typed operation handler for builder registration
func (SendEmail) Run ¶
func (SendEmail) Run(ctx context.Context, req types.OperationRequest, client *Client, cfg SendEmailRequest) (json.RawMessage, error)
Run resolves the email template, looks up the catalog dispatcher by Key, builds a typed payload from the template defaults + per-invocation recipient, and sends through the dispatcher
type SendEmailRequest ¶
type SendEmailRequest struct {
// TemplateID references the email template by database ID
TemplateID string `json:"templateId" jsonschema:"required,description=Email template ID"`
// OwnerID is the organization owner for template resolution
OwnerID string `json:"ownerId" jsonschema:"required,description=Organization owner ID"`
// To is the recipient email address
To string `json:"to" jsonschema:"required,description=Recipient email address"`
// Tags are delivery metadata tags for provider webhook correlation
Tags []newman.Tag `json:"tags,omitempty" jsonschema:"description=Delivery tracking tags"`
// From is an optional sender address override
From string `json:"from,omitempty" jsonschema:"description=Sender email address override"`
// ReplyTo is an optional reply-to address
ReplyTo string `json:"replyTo,omitempty" jsonschema:"description=Reply-to email address"`
}
SendEmailRequest is the operation config for dispatching a single templated email. The template is resolved by database ID; its Key selects the catalog entry that owns the render pipeline and its Defaults supplies the pre-filled typed fields
type SendQuestionnaireCampaign ¶
type SendQuestionnaireCampaign struct{}
SendQuestionnaireCampaign dispatches questionnaire access emails to all pending campaign targets, creating assessment responses and generating anonymous access tokens for each recipient
func (SendQuestionnaireCampaign) Handle ¶
func (s SendQuestionnaireCampaign) Handle() types.OperationHandler
Handle returns the typed operation handler for builder registration
func (SendQuestionnaireCampaign) Run ¶
func (SendQuestionnaireCampaign) Run(ctx context.Context, req types.OperationRequest, client *Client, cfg SendQuestionnaireCampaignRequest) (json.RawMessage, error)
Run loads the campaign and its assessment, iterates pending targets, creates assessment responses, generates anonymous JWT access tokens, and sends questionnaire access emails
type SendQuestionnaireCampaignRequest ¶
type SendQuestionnaireCampaignRequest struct {
CampaignDispatchInput
// TestEmail dispatches a single test questionnaire email without adding a campaign target
TestEmail string `json:"testEmail,omitempty" jsonschema:"description=Recipient email for a test questionnaire send"`
}
SendQuestionnaireCampaignRequest is the operation config for dispatching a questionnaire campaign
type SocialLink ¶
type SocialLink struct {
// Platform is the display label for the social network (e.g. X, LinkedIn)
Platform string `json:"platform" koanf:"platform" jsonschema:"required,description=Display label for the social network"`
// IconURL is the publicly reachable URL of the icon image
IconURL string `json:"iconURL" koanf:"iconURL" jsonschema:"required,description=Publicly reachable icon image URL"`
// URL is the destination the icon links to
URL string `json:"url" koanf:"url" jsonschema:"required,description=Destination URL the icon links to"`
}
SocialLink is a single social media footer entry: platform label, icon image URL, and destination URL
type SubprocessorEntry ¶ added in v1.27.3
type SubprocessorEntry struct {
// Name is the subprocessor display name
Name string `json:"name" jsonschema:"required,description=Subprocessor name"`
// Change is the human-readable kind of change (Added, Updated, or Removed)
Change string `json:"change,omitempty" jsonschema:"description=Kind of change: Added, Updated, or Removed"`
}
SubprocessorEntry is a single changed vendor listed in a subprocessor notification: the vendor name and the kind of change. No logo, link, or other detail is rendered
type SubprocessorNotificationRequest ¶ added in v1.27.3
type SubprocessorNotificationRequest struct {
// RecipientInfo carries the recipient email and the per-send unsubscribe token. Unlike the campaign
// branded message (which is rendered internally), this system email is dispatched directly, so the
// recipient fields must be part of the reflected schema for dispatch-input validation to accept them
RecipientInfo
// TrustCenterBranding is the trust center's visual identity overlay; empty values fall back to the
// Openlane system branding
TrustCenterBranding
// Subprocessors is the list of changed vendors rendered as a formatted list
Subprocessors []SubprocessorEntry `json:"subprocessors,omitempty" jsonschema:"description=Changed subprocessors rendered as a list"`
// TrustCenterURL is the public trust center link the call-to-action button navigates to
TrustCenterURL string `json:"trustCenterURL,omitempty" jsonschema:"format=uri,description=Public trust center URL for the call-to-action button"`
// UnsubscribeURL is the per-recipient trust center unsubscribe link shown in the footer, resolved
// with the subscriber's token by the caller (this system email is dispatched directly and so does
// not run the campaign's {{ .unsubscribeToken }} template interpolation)
UnsubscribeURL string `json:"unsubscribeURL,omitempty" jsonschema:"description=Unsubscribe link shown in the footer"`
}
SubprocessorNotificationRequest is the fixed-format system message notifying trust center subscribers about subprocessor changes. It is dispatched per recipient as a system email; the caller supplies only data (the changed vendors, links, and trust center branding) while the subject and body copy are composed by the operation, leading with the trust center's company name when branded
type SubscribeRequest ¶
type SubscribeRequest struct {
RecipientInfo
// TrustCenterBranding is the trust center's visual identity overlay; empty values fall back to the
// trust center button treatment on the Openlane system branding
TrustCenterBranding
// OrgName is the display name of the subscribing organization
OrgName string `json:"org_name" jsonschema:"required,description=Organization display name"`
// Token is the subscriber verification token appended to the verify URL
Token string `json:"token" jsonschema:"required,description=Subscriber verification token"`
// VerifyURL is the trust-center-domain confirmation link the button points at; empty falls back to the
// API-direct verify endpoint (organization-level subscribers with no trust center)
VerifyURL string `json:"verifyURL,omitempty" jsonschema:"description=Trust center subscription confirmation link the button points at"`
// UnsubscribeURL is the trust center's tokenized unsubscribe link shown in the footer; built by the
// caller from the trust center domain since the operation has no access to it
UnsubscribeURL string `json:"unsubscribeURL,omitempty" jsonschema:"description=Trust center unsubscribe link shown in the footer"`
}
SubscribeRequest is the input for the subscription verification operation
type TargetSendFunc ¶
type TargetSendFunc func(ctx context.Context, target *generated.CampaignTarget) error
TargetSendFunc is per-target callback invoked by dispatchCampaignTargets for each dispatchable target
type TrustCenterAuthEmail ¶
type TrustCenterAuthEmail struct {
RecipientInfo
// OrgName is the organization whose trust center is being accessed; resolved from TrustCenterID when empty
OrgName string `json:"org_name,omitempty" jsonschema:"description=Organization name"`
// RequestID is the NDA request identifier used for JWT subject construction
RequestID string `json:"requestId,omitempty" jsonschema:"description=NDA request ID for token generation"`
// TrustCenterID is the trust center identifier used for URL construction
TrustCenterID string `json:"trustCenterId,omitempty" jsonschema:"description=Trust center ID for URL construction"`
// AuthURL is the authentication URL for trust center access; when empty the operation constructs it from RequestID and TrustCenterID
AuthURL string `json:"authUrl,omitempty" jsonschema:"description=Trust center auth URL"`
}
TrustCenterAuthEmail is the input for trust center access authentication. Callers may pass either the pre-built AuthURL or the RequestID + TrustCenterID pair; when AuthURL is empty the operation resolves it from RequestID and TrustCenterID. OrgName is resolved from TrustCenterID when empty
type TrustCenterBranding ¶ added in v1.27.7
type TrustCenterBranding struct {
// CompanyName overrides the footer company name with the trust center's branding when present
CompanyName string `json:"companyName,omitempty" jsonschema:"description=Company display name shown in the footer"`
// LogoURL overrides the hero and header logo with the trust center's branding when present
LogoURL string `json:"logoURL,omitempty" jsonschema:"format=uri,description=Hero logo URL override"`
// AccentColor is the trust center's accent, applied to decorative borders only
AccentColor string `json:"accentColor,omitempty" jsonschema:"format=color,description=Accent color applied to decorative borders (hex)"`
}
TrustCenterBranding carries the trust center identity applied to subscriber-facing emails. Trust center palettes are authored for the web, where dark themes are common, so emails never hand the configured colors control of the containers, text, buttons, or backgrounds — the accent color is applied only to decorative details (borders), where any value is safe
func TrustCenterBrandingFromSetting ¶ added in v1.27.7
func TrustCenterBrandingFromSetting(setting *generated.TrustCenterSetting) TrustCenterBranding
TrustCenterBrandingFromSetting maps a trust center setting's identity onto the email branding overlay; a nil setting yields the zero overlay so every value falls back to the system branding. The setting's background, foreground, and button-driving colors are web-only and never map into emails; the accent (falling back to the primary color) surfaces only as a decorative border
type TrustCenterNDAApprovalRequestEmail ¶ added in v1.23.1
type TrustCenterNDAApprovalRequestEmail struct {
RecipientInfo
// OrgName is the organization whose trust center received the NDA request
OrgName string `json:"org_name" jsonschema:"required,description=Organization name"`
// RequesterName is the name of the person requesting access
RequesterName string `json:"requester_name,omitempty" jsonschema:"description=Name of the requester"`
// RequesterEmail is the email address of the person requesting access
RequesterEmail string `json:"requester_email" jsonschema:"required,description=Email address of the requester"`
}
TrustCenterNDAApprovalRequestEmail is the input for notifying the organization's designated approver that an NDA request is pending approval.
type TrustCenterNDARequestEmail ¶
type TrustCenterNDARequestEmail struct {
RecipientInfo
// OrgName is the organization requesting the NDA; resolved from TrustCenterID when empty
OrgName string `json:"org_name,omitempty" jsonschema:"description=Organization name"`
// RequestID is the NDA request identifier used for JWT subject construction
RequestID string `json:"requestId,omitempty" jsonschema:"description=NDA request ID for token generation"`
// TrustCenterID is the trust center identifier used for URL construction
TrustCenterID string `json:"trustCenterId,omitempty" jsonschema:"description=Trust center ID for URL construction"`
// NDAURL is the direct URL to the NDA signing page; when empty the operation constructs it from RequestID and TrustCenterID
NDAURL string `json:"ndaUrl,omitempty" jsonschema:"description=NDA signing URL"`
}
TrustCenterNDARequestEmail is the input for the trust center NDA signing request. Callers may pass either the pre-built NDAURL or the RequestID + TrustCenterID pair; when NDAURL is empty the operation resolves it from RequestID and TrustCenterID. OrgName is resolved from TrustCenterID when empty
type TrustCenterNDASignedEmail ¶
type TrustCenterNDASignedEmail struct {
RecipientInfo
// OrgName is the organization whose NDA was signed; resolved from TrustCenterID when empty
OrgName string `json:"org_name,omitempty" jsonschema:"description=Organization name"`
// TrustCenterURL is the URL to the trust center; when empty the operation constructs it with an auth token from RequestID and TrustCenterID
TrustCenterURL string `json:"trust_center_url,omitempty" jsonschema:"description=Trust center URL"`
// RequestID is the NDA request identifier used for JWT subject construction
RequestID string `json:"request_id,omitempty" jsonschema:"description=NDA request ID for token generation"`
// TrustCenterID is the trust center identifier used for URL construction
TrustCenterID string `json:"trust_center_id,omitempty" jsonschema:"description=Trust center ID for URL construction"`
// AttachmentFilename is the filename for the signed NDA attachment
AttachmentFilename string `json:"attachment_filename,omitempty" jsonschema:"description=Signed NDA attachment filename"`
// AttachmentData is the raw content of the signed NDA attachment
AttachmentData []byte `json:"attachment_data,omitempty" jsonschema:"description=Signed NDA attachment content"`
}
TrustCenterNDASignedEmail is the input for the NDA signed confirmation. Callers may pass either the pre-built TrustCenterURL or the RequestID + TrustCenterID pair; when TrustCenterURL is empty the operation resolves it (with an auth token) from RequestID and TrustCenterID. OrgName is resolved from TrustCenterID when empty
type TrustCenterUpdateRequest ¶ added in v1.27.7
type TrustCenterUpdateRequest struct {
RecipientInfo `jsonschema:"-"`
CampaignContext `jsonschema:"-"`
// TrustCenterBranding is the trust center's visual identity overlay; empty values fall back to the
// Openlane system branding
TrustCenterBranding
// PostTitle is the published post's title, shown as the post heading and in the subject
PostTitle string `json:"postTitle,omitempty" jsonschema:"description=Published post title"`
// PostText is the published post's body, rendered as paragraphs under the post heading
PostText string `json:"postText,omitempty" jsonschema:"description=Published post body text"`
// TrustCenterURL is the public trust center link the call-to-action button navigates to
TrustCenterURL string `json:"trustCenterURL,omitempty" jsonschema:"format=uri,description=Public trust center URL for the call-to-action button"`
// UnsubscribeURL is the unsubscribe link shown in the footer; campaign sends carry the
// {{ .unsubscribeToken }} placeholder interpolated per recipient at render time
UnsubscribeURL string `json:"unsubscribeURL,omitempty" jsonschema:"description=Unsubscribe link shown in the footer"`
}
TrustCenterUpdateRequest is the message notifying trust center subscribers about a newly published post. The caller supplies only data (the post, links, and trust center branding) while the subject and body copy are composed by the operation, leading with the trust center's company name when branded. Recipient and campaign fields are populated per send by the campaign dispatch, so they are excluded from the reflected schema
type UserInput ¶
type UserInput struct {
// FromEmail is the address customer-initiated emails are sent from, using the configured provider key
FromEmail string `json:"fromEmail" jsonschema:"required,description=Email address your emails are sent from using your configured provider key"`
// CompanyName is the display name shown in the email footer
CompanyName string `json:"companyName" jsonschema:"required,description=Company display name shown in the email footer"`
// CompanyAddress is the mailing address shown in the footer for CAN-SPAM compliance
CompanyAddress string `` /* 130-byte string literal not displayed */
}
UserInput is the installation-scoped configuration that customers provide when setting up their own email integration. It carries only the sender identity and the footer identity that cannot come from an email template. Email appearance and content (colors, layout, logos, body) are defined by the email template associated with the send, and trust center update emails additionally inherit the trust center's own branding, so those values are intentionally not collected here
func (UserInput) ToRuntimeConfig ¶
func (u UserInput) ToRuntimeConfig() RuntimeEmailConfig
ToRuntimeConfig converts customer user input to a RuntimeEmailConfig
type VerifyBillingRequest ¶
type VerifyBillingRequest struct {
RecipientInfo
// Token is the billing verification token appended to the verify URL
Token string `json:"token" jsonschema:"required,description=Billing verification token"`
}
VerifyBillingRequest is the input for the billing email verification operation
type VerifyEmailRequest ¶
type VerifyEmailRequest struct {
RecipientInfo
// Token is the email verification token appended to the verify URL
Token string `json:"token" jsonschema:"required,description=Email verification token"`
}
VerifyEmailRequest is the input for the email verification operation
type WelcomeRequest ¶
type WelcomeRequest struct {
RecipientInfo
}
WelcomeRequest is the input for the welcome email operation
Source Files
¶
- builder.go
- client.go
- compose.go
- doc.go
- emailop.go
- errors.go
- op_branded_message.go
- op_subprocessor_notification.go
- op_trustcenter_update.go
- operation_health.go
- operation_send_campaign.go
- operation_send_email.go
- operation_send_questionnaire_campaign.go
- system_emails.go
- template_catalog.go
- template_interpolate.go
- testing.go
- trustcenter_branding.go
- trustcenter_campaign.go
- types.go
- url.go
- webhook.go