Templates
Last updated
Last updated
Templates are the emails that are sent out by Gophish during a campaign.
The templates endpoint allows you to create, view, and manage Gophish templates.
This example shows how to retrieve the name of every template in Gophish.
Attributes
content
(str) The base64 encoded attachment content
type
(str) The content type of the attachment
name
(str) The attachment filename
Methods
__init__(self, **kwargs)
- Returns a new Attachment
Example:
A template contains a name and the email content.
Attributes
id
(int) The template ID
name
(str) The template name
html
(str) The template HTML
text
(str) The template HTML
modified_date
(optional: datetime.datetime) The scheduled time for template launch
attachments
(list(models.Attachment)) The optional email attachments
Methods
__init__(self, **kwargs)
- Returns a new Template
Example:
Gets the details for one or more templates. To get a particular template, set the ID to the template ID.
If the template_id
is not set, all templates owned by the current user will be returned.
Returns
If the template
is set: models.Template
If template_id
is None
: list(models.Template)
Creates a new template. This endpoint requires you to submit a gophish.models.Template
object.
Returns
The gophish.models.Template
object that was created.
Edits an existing template. This endpoint requires you to submit an existing gophish.models.Template
object with its id
attribute set correctly.
Returns
The gophish.models.Template
object that was edited.
Deletes the template specified by template_id
.
Returns
A gophish.models.Status
message.
Here are some examples to show how to use the API.
All of these examples assume the following setup: