Class FormMailService

java.lang.Object
sk.iway.iwcm.components.multistep_form.rest.FormMailService

@Service public class FormMailService extends Object
Prepares and sends notification emails for submitted multistep forms.

The service derives sender details from submitted fields, applies form mail settings, composes HTML or plain-text content, handles attachments, and supports immediate or delayed delivery.

  • Field Details

  • Constructor Details

    • FormMailService

      public FormMailService()
  • Method Details

    • sendMail

      public void sendMail(FormsEntity form, Map<String,String> formData, FormSettingsEntity formSettings, String recipients, String subject, SaveFormService.FormFiles formFiles, boolean attachFiles, String cssData, StringBuilder htmlData, jakarta.servlet.http.HttpServletRequest request) throws SaveFormException
      Sends a notification email for the given form submission.

      The method derives sender details from configured form fields, applies encoding and recipient settings, prepares HTML or plain-text content and attachments, and either sends immediately or schedules delayed delivery.

      Parameters:
      form - form entity with metadata and serialized field data
      formData - ordered, unencrypted values keyed by logical field IDs; text is HTML-escaped, WYSIWYG content is sanitized, and upload values contain saved filenames
      formSettings - form settings entity containing configuration for email sending
      recipients - comma‑separated list of recipient emails
      subject - email subject
      formFiles - uploaded files container to optionally attach
      attachFiles - when true attaches uploaded files to the email
      cssData - stylesheet markup whose relative paths are converted to absolute URLs
      htmlData - rendered form body HTML (will be transformed as needed)
      request - current HTTP request used for context and headers
      Throws:
      SaveFormException - when the submission is rejected for email reasons or the message cannot be sent or queued