Class CreateEmailCampaign

java.lang.Object
software.xdev.brevo.model.CreateEmailCampaign

public class CreateEmailCampaign extends Object
CreateEmailCampaign
  • Field Details

  • Constructor Details

    • CreateEmailCampaign

      public CreateEmailCampaign()
  • Method Details

    • tag

      public CreateEmailCampaign tag(@Nullable String tag)
    • getTag

      @Nullable public String getTag()
      Tag of the campaign
      Returns:
      tag
    • setTag

      public void setTag(@Nullable String tag)
    • sender

      public CreateEmailCampaign sender(@Nonnull CreateEmailCampaignSender sender)
    • getSender

      @Nonnull public CreateEmailCampaignSender getSender()
      Get sender
      Returns:
      sender
    • setSender

      public void setSender(@Nonnull CreateEmailCampaignSender sender)
    • name

      public CreateEmailCampaign name(@Nonnull String name)
    • getName

      @Nonnull public String getName()
      Name of the campaign
      Returns:
      name
    • setName

      public void setName(@Nonnull String name)
    • htmlContent

      public CreateEmailCampaign htmlContent(@Nullable String htmlContent)
    • getHtmlContent

      @Nullable public String getHtmlContent()
      Mandatory if htmlUrl and templateId are empty. Body of the message (HTML).
      Returns:
      htmlContent
    • setHtmlContent

      public void setHtmlContent(@Nullable String htmlContent)
    • htmlUrl

      public CreateEmailCampaign htmlUrl(@Nullable String htmlUrl)
    • getHtmlUrl

      @Nullable public String getHtmlUrl()
      **Mandatory if htmlContent and templateId are empty**. Url to the message (HTML). For example: **https://html.domain.com**
      Returns:
      htmlUrl
    • setHtmlUrl

      public void setHtmlUrl(@Nullable String htmlUrl)
    • templateId

      public CreateEmailCampaign templateId(@Nullable Long templateId)
    • getTemplateId

      @Nullable public Long getTemplateId()
      **Mandatory if htmlContent and htmlUrl are empty**. Id of the transactional email template with status _active_. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature.
      Returns:
      templateId
    • setTemplateId

      public void setTemplateId(@Nullable Long templateId)
    • scheduledAt

      public CreateEmailCampaign scheduledAt(@Nullable String scheduledAt)
    • getScheduledAt

      @Nullable public String getScheduledAt()
      Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result**. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). For example: **2017-06-01T12:30:00+02:00**
      Returns:
      scheduledAt
    • setScheduledAt

      public void setScheduledAt(@Nullable String scheduledAt)
    • subject

      public CreateEmailCampaign subject(@Nullable String subject)
    • getSubject

      @Nullable public String getSubject()
      Subject of the campaign. **Mandatory if abTesting is false**. Ignored if abTesting is true.
      Returns:
      subject
    • setSubject

      public void setSubject(@Nullable String subject)
    • previewText

      public CreateEmailCampaign previewText(@Nullable String previewText)
    • getPreviewText

      @Nullable public String getPreviewText()
      Preview text or preheader of the email campaign
      Returns:
      previewText
    • setPreviewText

      public void setPreviewText(@Nullable String previewText)
    • replyTo

      public CreateEmailCampaign replyTo(@Nullable String replyTo)
    • getReplyTo

      @Nullable public String getReplyTo()
      Email on which the campaign recipients will be able to reply to
      Returns:
      replyTo
    • setReplyTo

      public void setReplyTo(@Nullable String replyTo)
    • toField

      public CreateEmailCampaign toField(@Nullable String toField)
    • getToField

      @Nullable public String getToField()
      To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization
      Returns:
      toField
    • setToField

      public void setToField(@Nullable String toField)
    • recipients

      public CreateEmailCampaign recipients(@Nullable CreateEmailCampaignRecipients recipients)
    • getRecipients

      @Nullable public CreateEmailCampaignRecipients getRecipients()
      Get recipients
      Returns:
      recipients
    • setRecipients

      public void setRecipients(@Nullable CreateEmailCampaignRecipients recipients)
    • attachmentUrl

      public CreateEmailCampaign attachmentUrl(@Nullable String attachmentUrl)
    • getAttachmentUrl

      @Nullable public String getAttachmentUrl()
      Absolute url of the attachment (no local file). Extension allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps
      Returns:
      attachmentUrl
    • setAttachmentUrl

      public void setAttachmentUrl(@Nullable String attachmentUrl)
    • inlineImageActivation

      public CreateEmailCampaign inlineImageActivation(@Nullable Boolean inlineImageActivation)
    • getInlineImageActivation

      @Nullable public Boolean getInlineImageActivation()
      Use true to embedded the images in your email. Final size of the email should be less than **4MB**. Campaigns with embedded images can _not be sent to more than 5000 contacts_
      Returns:
      inlineImageActivation
    • setInlineImageActivation

      public void setInlineImageActivation(@Nullable Boolean inlineImageActivation)
    • mirrorActive

      public CreateEmailCampaign mirrorActive(@Nullable Boolean mirrorActive)
    • getMirrorActive

      @Nullable public Boolean getMirrorActive()
      Use true to enable the mirror link
      Returns:
      mirrorActive
    • setMirrorActive

      public void setMirrorActive(@Nullable Boolean mirrorActive)
    • footer

      public CreateEmailCampaign footer(@Nullable String footer)
    • getFooter

      @Nullable public String getFooter()
      Footer of the email campaign
      Returns:
      footer
    • setFooter

      public void setFooter(@Nullable String footer)
    • header

      public CreateEmailCampaign header(@Nullable String header)
    • getHeader

      @Nullable public String getHeader()
      Header of the email campaign
      Returns:
      header
    • setHeader

      public void setHeader(@Nullable String header)
    • utmCampaign

      public CreateEmailCampaign utmCampaign(@Nullable String utmCampaign)
    • getUtmCampaign

      @Nullable public String getUtmCampaign()
      Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed
      Returns:
      utmCampaign
    • setUtmCampaign

      public void setUtmCampaign(@Nullable String utmCampaign)
    • params

      public CreateEmailCampaign params(@Nullable Map<String,Object> params)
    • putParamsItem

      public CreateEmailCampaign putParamsItem(String key, Object paramsItem)
    • getParams

      @Nullable public Map<String,Object> getParams()
      Pass the set of attributes to customize the type classic campaign. For example: **{\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}**. Only available if **type** is **classic**. It's considered only if campaign is in _New Template Language format_. The New Template Language is dependent on the values of **subject, htmlContent/htmlUrl, sender.name & toField**
      Returns:
      params
    • setParams

      public void setParams(@Nullable Map<String,Object> params)
    • sendAtBestTime

      public CreateEmailCampaign sendAtBestTime(@Nullable Boolean sendAtBestTime)
    • getSendAtBestTime

      @Nullable public Boolean getSendAtBestTime()
      Set this to true if you want to send your campaign at best time.
      Returns:
      sendAtBestTime
    • setSendAtBestTime

      public void setSendAtBestTime(@Nullable Boolean sendAtBestTime)
    • abTesting

      public CreateEmailCampaign abTesting(@Nullable Boolean abTesting)
    • getAbTesting

      @Nullable public Boolean getAbTesting()
      Status of A/B Test. abTesting = false means it is disabled & abTesting = true means it is enabled. **subjectA, subjectB, splitRule, winnerCriteria & winnerDelay** will be considered when abTesting is set to true. subjectA & subjectB are mandatory together & subject if passed is ignored. **Can be set to true only if sendAtBestTime is false**. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B
      Returns:
      abTesting
    • setAbTesting

      public void setAbTesting(@Nullable Boolean abTesting)
    • subjectA

      public CreateEmailCampaign subjectA(@Nullable String subjectA)
    • getSubjectA

      @Nullable public String getSubjectA()
      Subject A of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value
      Returns:
      subjectA
    • setSubjectA

      public void setSubjectA(@Nullable String subjectA)
    • subjectB

      public CreateEmailCampaign subjectB(@Nullable String subjectB)
    • getSubjectB

      @Nullable public String getSubjectB()
      Subject B of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value
      Returns:
      subjectB
    • setSubjectB

      public void setSubjectB(@Nullable String subjectB)
    • splitRule

      public CreateEmailCampaign splitRule(@Nullable Long splitRule)
    • getSplitRule

      @Nullable public Long getSplitRule()
      Add the size of your test groups. **Mandatory if abTesting = true & 'recipients' is passed**. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else minimum: 1 maximum: 50
      Returns:
      splitRule
    • setSplitRule

      public void setSplitRule(@Nullable Long splitRule)
    • winnerCriteria

      public CreateEmailCampaign winnerCriteria(@Nullable CreateEmailCampaign.WinnerCriteriaEnum winnerCriteria)
    • getWinnerCriteria

      @Nullable public CreateEmailCampaign.WinnerCriteriaEnum getWinnerCriteria()
      Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed
      Returns:
      winnerCriteria
    • setWinnerCriteria

      public void setWinnerCriteria(@Nullable CreateEmailCampaign.WinnerCriteriaEnum winnerCriteria)
    • winnerDelay

      public CreateEmailCampaign winnerDelay(@Nullable Long winnerDelay)
    • getWinnerDelay

      @Nullable public Long getWinnerDelay()
      Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerDelay` is ignored if passed minimum: 1 maximum: 168
      Returns:
      winnerDelay
    • setWinnerDelay

      public void setWinnerDelay(@Nullable Long winnerDelay)
    • ipWarmupEnable

      public CreateEmailCampaign ipWarmupEnable(@Nullable Boolean ipWarmupEnable)
    • getIpWarmupEnable

      @Nullable public Boolean getIpWarmupEnable()
      **Available for dedicated ip clients**. Set this to true if you wish to warm up your ip.
      Returns:
      ipWarmupEnable
    • setIpWarmupEnable

      public void setIpWarmupEnable(@Nullable Boolean ipWarmupEnable)
    • initialQuota

      public CreateEmailCampaign initialQuota(@Nullable Long initialQuota)
    • getInitialQuota

      @Nullable public Long getInitialQuota()
      **Mandatory if ipWarmupEnable is set to true**. Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000.
      Returns:
      initialQuota
    • setInitialQuota

      public void setInitialQuota(@Nullable Long initialQuota)
    • increaseRate

      public CreateEmailCampaign increaseRate(@Nullable Long increaseRate)
    • getIncreaseRate

      @Nullable public Long getIncreaseRate()
      **Mandatory if ipWarmupEnable is set to true**. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. minimum: 0 maximum: 100
      Returns:
      increaseRate
    • setIncreaseRate

      public void setIncreaseRate(@Nullable Long increaseRate)
    • unsubscriptionPageId

      public CreateEmailCampaign unsubscriptionPageId(@Nullable String unsubscriptionPageId)
    • getUnsubscriptionPageId

      @Nullable public String getUnsubscriptionPageId()
      Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page. If not entered, then the default unsubscription page will be used.
      Returns:
      unsubscriptionPageId
    • setUnsubscriptionPageId

      public void setUnsubscriptionPageId(@Nullable String unsubscriptionPageId)
    • updateFormId

      public CreateEmailCampaign updateFormId(@Nullable String updateFormId)
    • getUpdateFormId

      @Nullable public String getUpdateFormId()
      **Mandatory if templateId is used containing the {{ update_profile }} tag**. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form. If not entered, then the default update profile form will be used.
      Returns:
      updateFormId
    • setUpdateFormId

      public void setUpdateFormId(@Nullable String updateFormId)
    • emailExpirationDate

      public CreateEmailCampaign emailExpirationDate(@Nullable CreateEmailCampaignEmailExpirationDate emailExpirationDate)
    • getEmailExpirationDate

      @Nullable public CreateEmailCampaignEmailExpirationDate getEmailExpirationDate()
      Get emailExpirationDate
      Returns:
      emailExpirationDate
    • setEmailExpirationDate

      public void setEmailExpirationDate(@Nullable CreateEmailCampaignEmailExpirationDate emailExpirationDate)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toUrlQueryString

      public String toUrlQueryString()
      Convert the instance into URL query string.
      Returns:
      URL query string
    • toUrlQueryString

      public String toUrlQueryString(String prefix)
      Convert the instance into URL query string.
      Parameters:
      prefix - prefix of the query string
      Returns:
      URL query string