Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ConfirmError = Data{
PageTitle: "Confirm",
ContentTitle: "Confirm Error",
Content: `An error occurred when you requested to confirm your account.
The problem has been forwarded to our team automatically. We will look into it and come
back to you. We apologise for this inconvenience.`,
}
ConfirmError encapsulates the information displayed to the user when confirming an account fails.
var ConfirmSuccess = Data{
PageTitle: "Confirm",
ContentTitle: "Confirmation Successful",
Content: "Your account has been confirmed. You will now receive an email whenever there are new heavy metal releases to headbang to.",
}
ConfirmSuccess encapsulates the information displayed to the user when confirming an account succeeds.
var NoDuplicateUsersError = Data{
PageTitle: "Start",
ContentTitle: "Start Service Error",
Content: `We are unable to process your request to sign up for our service again using the same email address
that is currently associated with an active account. Our policy prohibits multiple accounts
with the same email address.`,
}
NoDuplicateUsersError encapsulates the information displayed to the user when stopping their service fails.
var StopError = Data{
PageTitle: "Stop",
ContentTitle: "Stop Service Error",
Content: `An error occurred when you requested to stop using our service.
The problem has been forwarded to our team automatically. We will look into it and come
back to you. We apologise for this inconvenience.`,
}
StopError encapsulates the information displayed to the user when stopping their service fails.
var UserLimitReachedError = Data{
PageTitle: "User Limit Reached",
ContentTitle: "User Limit Reached",
Content: `You cannot register because the user limit has been reached. This limit depends on the SendGrid API key.
You can sponsor the author of this project or buy him a coffee for him to have enough money to purchase
the paid SendGrid plan to increase the limit. You will find the details here:
https://github.com/reaper47/heavy-metal-notifier?tab=readme-ov-file#sponsors.`,
}
UserLimitReachedError encapsulates the information displayed to the user when the user limit has been reached. The limit depends on the SendGrid API key.
Functions ¶
func Render ¶
func Render(w http.ResponseWriter, name string, data any) error
Render is a wrapper for template.ExecuteTemplate.
func RenderEmail ¶
RenderEmail is a wrapper for template.ExecuteTemplate on email templates.
Types ¶
type Data ¶
type Data struct { IsAboutPage bool IsContactPage bool IsMessageSent bool IsHomePage bool PageTitle string ContentTitle string Content string EmailBase64 string }
Data holds general template data.
type EmailData ¶
type EmailData struct { From string Message string URL string EmailBase64 string Name string Releases []models.Release Text string }
EmailData holds data for email templates.
type EmailTemplate ¶ added in v1.3.0
type EmailTemplate string
EmailTemplate represents the name of a .mjml email template.
const ( EmailContact EmailTemplate = "contact.mjml" EmailEndOfService EmailTemplate = "end-of-service.mjml" EmailErrorAdmin EmailTemplate = "error-admin.mjml" EmailIntro EmailTemplate = "intro.mjml" EmailReleases EmailTemplate = "releases.mjml" )
func (EmailTemplate) String ¶ added in v1.3.0
func (e EmailTemplate) String() string
String represents the email template as a string, being the file name.
func (EmailTemplate) Subject ¶ added in v1.3.0
func (e EmailTemplate) Subject() string
Subject returns the subject of the email according to the type of email being sent.