This is a Typo3 Extension that allows you to easily send Mails from any form in your website via Ajax.
The Extension was created to have a quick way to add easy contact forms on modern Typo3 Fluid websites. The idea is that you can add a form anywhere on the website and submit it via ajax to send the mail.
- JQuery v1
- Copy the folder ajaxmail to your typo3conf/ext/ directory
- Install the extension with your Typo3 Extension Manager
- Add the static TS-Template to your template
- Add the file typo3conf/ext/ajaxmail/Resources/Public/Js/ajaxmail.js to your website
- That's it - Read How to use it to learn more
- Add a new Sys-Folder to your Typo3 pagetree
- Add a Mail Template (content element ) and fill it as you want.
- Set sender, receiver and so on. You can use variables by using {} - learn more about that in a second
- Remember the UID of your form
- Add a form to your website. Look at this example
<form method="post" class="ajaxMail">
<input type="hidden" name="tx_ajaxmail_ajax[tid]" value="1" />
<input type="text" placeholder="Name" name="tx_ajaxmail_ajax[Name]" required/>
<input type="email" placeholder="Email*" name="tx_ajaxmail_ajax[Email]" required/>
<textarea name="tx_ajaxmail_ajax[Comments]" placeholder="Comments ..."></textarea>
<input type="submit" value="send" />
</form>
- Important: Form has to have the class ajaxMail
- Important: there must be a field with the name tx_ajaxmail_ajax[tid] that has the UID of your template as value
- Important: All fields that you need in your mail have to have a name like: tx_ajaxmail_ajax[...]
- You can easily use variables in your Mail Template by wraping {} around the variable name.
- If you want to acceess the name field in the example just write {Name}
- You can use {all} as a special variable that lists all submited variables in a list e.g. Name: John, Email: [email protected] ...
- You can also use the variables in the subject, receiver and all other field e.g. if you want to send a confirmation mail to the user just add {Email} as the confirmation receiver
- You can add an optional SQL statement that is executed after the mails were sent. Here you you can also use the variable e.g.
'''
INSERT INTO table (
field
) VALUES ('{Variable}') '''
- Localization
- Attachments