Beta version

class ContactFormManager extends EmailManager

Class ContactFormManager

Methods

__construct(Request $request, FormFactoryInterface $formFactory, TranslatorInterface $translator, Twig_Environment $templating, Swift_Mailer $mailer, Settings $settingsBag)

ContactFormManager constructor.

string
renderHtmlEmailBody()

No description

string
renderHtmlEmailBodyWithCss()

No description

string
renderPlainTextEmailBody()

No description

appendWebsiteIcon()

Added mainColor and headerImageSrc assignation to display email header.

Swift_Message
createMessage()

No description

int
send()

Send contact form data by email.

null|string
getSubject()

No description

setSubject(null|string $subject)

No description

null|string
getEmailTitle()

No description

setEmailTitle(null|string $emailTitle)

No description

bool|null|string
getReceiver()

No description

null|string
getReceiverEmail()

Return only one email as string.

setReceiver(string|array $receiver)

Sets the value of receiver.

null|string
getSender()

Message virtual sender email.

null|string
getSenderEmail()

Return only one email as string.

setSender(string|array $sender)

Sets the value of sender.

string
getSuccessMessage()

No description

setSuccessMessage(string $successMessage)

No description

string
getFailMessage()

No description

setFailMessage(string $failMessage)

No description

TranslatorInterface
getTranslator()

No description

setTranslator(TranslatorInterface $translator)

No description

Twig_Environment
getTemplating()

No description

setTemplating(Twig_Environment $templating)

No description

Swift_Mailer
getMailer()

No description

setMailer(Swift_Mailer $mailer)

No description

string|null
getEmailTemplate()

No description

setEmailTemplate(string|null $emailTemplate = null)

No description

string|null
getEmailPlainTextTemplate()

No description

setEmailPlainTextTemplate(string|null $emailPlainTextTemplate = null)

No description

string|null
getEmailStylesheet()

No description

setEmailStylesheet(string|null $emailStylesheet = null)

No description

Request
getRequest()

No description

setRequest(Request $request)

No description

null|string
getOrigin()

Origin is the real From enveloppe.

setOrigin(string $origin)

No description

array
getAssignation()

No description

setAssignation(array $assignation)

No description

FormBuilderInterface
getFormBuilder()

No description

Form
getForm()

No description

withDefaultFields()

Adds a email, name and message fields with their constraints.

withGoogleRecaptcha()

Add a Google recaptcha to your contact form.

Response|null
handle()

Handle custom form validation and send it as an email.

string
getRedirectUrl()

Gets the value of redirectUrl.

setRedirectUrl(string $redirectUrl)

Sets the value of redirectUrl.

int
getMaxFileSize()

Gets the value of maxFileSize.

setMaxFileSize(int $maxFileSize)

Sets the value of maxFileSize.

array
getAllowedMimeTypes()

Gets the value of allowedMimeTypes.

setAllowedMimeTypes(array $allowedMimeTypes)

Sets the value of allowedMimeTypes.

Details

at line 101
__construct(Request $request, FormFactoryInterface $formFactory, TranslatorInterface $translator, Twig_Environment $templating, Swift_Mailer $mailer, Settings $settingsBag)

ContactFormManager constructor.

DO NOT DIRECTLY USE THIS CONSTRUCTOR USE 'contactFormManager' Factory Service

Parameters

Request $request
FormFactoryInterface $formFactory
TranslatorInterface $translator
Twig_Environment $templating
Swift_Mailer $mailer
Settings $settingsBag

in EmailManager at line 142
string renderHtmlEmailBody()

Return Value

string

in EmailManager at line 150
string renderHtmlEmailBodyWithCss()

Return Value

string

in EmailManager at line 167
string renderPlainTextEmailBody()

Return Value

string

in EmailManager at line 178
EmailManager appendWebsiteIcon()

Added mainColor and headerImageSrc assignation to display email header.

Return Value

EmailManager

in EmailManager at line 199
Swift_Message createMessage()

Return Value

Swift_Message

at line 400
int send()

Send contact form data by email.

Return Value

int

Exceptions

RuntimeException

in EmailManager at line 252
null|string getSubject()

Return Value

null|string

in EmailManager at line 261
EmailManager setSubject(null|string $subject)

Parameters

null|string $subject

Return Value

EmailManager

in EmailManager at line 270
null|string getEmailTitle()

Return Value

null|string

in EmailManager at line 279
EmailManager setEmailTitle(null|string $emailTitle)

Parameters

null|string $emailTitle

Return Value

EmailManager

at line 504
bool|null|string getReceiver()

Return Value

bool|null|string

in EmailManager at line 300
null|string getReceiverEmail()

Return only one email as string.

Return Value

null|string

in EmailManager at line 318
EmailManager setReceiver(string|array $receiver)

Sets the value of receiver.

Parameters

string|array $receiver the receiver

Return Value

EmailManager

Exceptions

Exception

in EmailManager at line 344
null|string getSender()

Message virtual sender email.

This email will be used as ReplyTo: and ReturnPath:

Return Value

null|string

in EmailManager at line 354
null|string getSenderEmail()

Return only one email as string.

Return Value

null|string

in EmailManager at line 371
EmailManager setSender(string|array $sender)

Sets the value of sender.

Parameters

string|array $sender the sender

Return Value

EmailManager

Exceptions

Exception

in EmailManager at line 393
string getSuccessMessage()

Return Value

string

in EmailManager at line 402
EmailManager setSuccessMessage(string $successMessage)

Parameters

string $successMessage

Return Value

EmailManager

in EmailManager at line 411
string getFailMessage()

Return Value

string

in EmailManager at line 420
EmailManager setFailMessage(string $failMessage)

Parameters

string $failMessage

Return Value

EmailManager

in EmailManager at line 429
TranslatorInterface getTranslator()

Return Value

TranslatorInterface

in EmailManager at line 438
EmailManager setTranslator(TranslatorInterface $translator)

Parameters

TranslatorInterface $translator

Return Value

EmailManager

in EmailManager at line 447
Twig_Environment getTemplating()

Return Value

Twig_Environment

in EmailManager at line 456
EmailManager setTemplating(Twig_Environment $templating)

Parameters

Twig_Environment $templating

Return Value

EmailManager

in EmailManager at line 465
Swift_Mailer getMailer()

Return Value

Swift_Mailer

in EmailManager at line 474
EmailManager setMailer(Swift_Mailer $mailer)

Parameters

Swift_Mailer $mailer

Return Value

EmailManager

in EmailManager at line 483
string|null getEmailTemplate()

Return Value

string|null

in EmailManager at line 492
EmailManager setEmailTemplate(string|null $emailTemplate = null)

Parameters

string|null $emailTemplate

Return Value

EmailManager

in EmailManager at line 501
string|null getEmailPlainTextTemplate()

Return Value

string|null

in EmailManager at line 510
EmailManager setEmailPlainTextTemplate(string|null $emailPlainTextTemplate = null)

Parameters

string|null $emailPlainTextTemplate

Return Value

EmailManager

in EmailManager at line 519
string|null getEmailStylesheet()

Return Value

string|null

in EmailManager at line 528
EmailManager setEmailStylesheet(string|null $emailStylesheet = null)

Parameters

string|null $emailStylesheet

Return Value

EmailManager

in EmailManager at line 537
Request getRequest()

Return Value

Request

in EmailManager at line 546
EmailManager setRequest(Request $request)

Parameters

Request $request

Return Value

EmailManager

in EmailManager at line 560
null|string getOrigin()

Origin is the real From enveloppe.

This must be an email address with a know domain name to be validated on your SMTP server.

Return Value

null|string

in EmailManager at line 571
EmailManager setOrigin(string $origin)

Parameters

string $origin

Return Value

EmailManager

in EmailManager at line 584
array getAssignation()

Return Value

array

in EmailManager at line 593
EmailManager setAssignation(array $assignation)

Parameters

array $assignation

Return Value

EmailManager

at line 137
FormBuilderInterface getFormBuilder()

Return Value

FormBuilderInterface

at line 145
Form getForm()

Return Value

Form

at line 155
ContactFormManager withDefaultFields()

Adds a email, name and message fields with their constraints.

Return Value

ContactFormManager $this

at line 197
ContactFormManager withGoogleRecaptcha()

Add a Google recaptcha to your contact form.

Make sure you’ve added recaptcha form template and filled recaptchapublickey and recaptchaprivatekey settings.

{% block recaptchawidget -%}

{%- endblock recaptchawidget %}

Return Value

ContactFormManager $this

at line 227
Response|null handle()

Handle custom form validation and send it as an email.

Return Value

Response|null

at line 434
string getRedirectUrl()

Gets the value of redirectUrl.

Return Value

string

at line 446
ContactFormManager setRedirectUrl(string $redirectUrl)

Sets the value of redirectUrl.

Parameters

string $redirectUrl the redirect url

Return Value

ContactFormManager

at line 458
int getMaxFileSize()

Gets the value of maxFileSize.

Return Value

int

at line 470
ContactFormManager setMaxFileSize(int $maxFileSize)

Sets the value of maxFileSize.

Parameters

int $maxFileSize the max file size

Return Value

ContactFormManager

at line 482
array getAllowedMimeTypes()

Gets the value of allowedMimeTypes.

Return Value

array

at line 494
ContactFormManager setAllowedMimeTypes(array $allowedMimeTypes)

Sets the value of allowedMimeTypes.

Parameters

array $allowedMimeTypes the allowed mime types

Return Value

ContactFormManager