Contact form

If you're using the PRO-Version of TYPO3-AMP you can add a contact form to the AMP page.

  • Install the PRO-Version of TYPO3-AMP
  • Include the static template AMP - 4. PRO: Form
  • Make sure your website runs under https (http will not work).

You need to activate the required AMP Libraries:

plugin.tx_amp {
    settings {
        amp {
            libraries {
                form = 1
                mustache = 1
            }
        }
    }
}

Finally, you need to configure the form:

plugin.tx_amp {
    settings {
        amp {
            forms {
                contact {
                    key = contact
                    enabled = 1
                    headline = Kontakt aufnehmen
                    messages {
                        success = Anfrage wurde erfolgreich versandt. Wir werden uns in Kürze mit Ihnen in Verbindung setzen.
                    }
                    fields {
                        canonical {
                            type = Hidden
                            section = ValueFromTypoScript
                            required = 0
                            value = lib.amp.canonicalUrl
                            # Label for E-Mailmessage
                            label = Article
                        }
                        article {
                            type = Hidden
                            section = ValueFromTypoScript
                            required = 0
                            value = lib.amp.url
                            # Label for E-Mailmessage
                            label = Article
                            ignoreInEmail = 1
                        }
                        company {
                            label = Firma
                            placeholder = Mustermann GmbH
                            type = Input
                            section = Default
                            required = 0
                            value =
                        }
                        name {
                            label = Name
                            placeholder = Name
                            type = Input
                            section = Default
                            required = 1
                            validation {
                                NotEmpty = Bitte geben Sie Ihren Namen ein
                            }
                            value =
                        }
                        email {
                            label = E-Mail
                            placeholder = E-Mailadresse
                            type = Email
                            section = Default
                            required = 1
                            validation {
                                NotEmpty = Bitte geben Sie Ihre E-Mailadresse ein
                                Email = Bitte geben Sie eine gültige E-Mailadresse ein
                            }
                            value =
                        }
                        phone {
                            label = Telefon
                            placeholder = Telefon
                            type = Input
                            section = Default
                            value =
                        }
                        message {
                            label = Nachricht
                            placeholder = Ihr Anliegen
                            type = Textarea
                            section = Default
                            required = 1
                            validation {
                                NotEmpty = Bitte geben Sie eine Nachricht ein
                            }
                            value =
                        }
                        submit {
                            label =
                            value = Anliegen abschicken
                            type = Submit
                            section = Default
                        }
                    }
                    # Finisher
                    finisher {
                        mail {
                            # Class/Object
                            type = Mail
                            active = 1
                            subject = TYPO3-AMP: Kontaktanfrage
                            message {
                                header.0 = Dear admin,
                                header.1 = this is a contact request.
                                header.2 =
                                header.3 = Fields:

                                footer.0 = ---
                                footer.1 = Thanks for you attention
                            }
                            from {
                                name = Website which is using TYPO3-AMP
                                email = typo3(at)coding(dot)ms
                            }
                            to {
                                0 {
                                    name = TYPO3-AMP Form (TO)
                                    email = typo3(at)coding(dot)ms
                                }
                                #1 {
                                #   name = TYPO3-AMP Form (TO-2)
                                #   email = typo3(at)coding(dot)ms
                                #}
                            }
                            cc {
                                #0 {
                                #   name = TYPO3-AMP Form (CC)
                                #   email = typo3(at)coding(dot)ms
                                #}
                            }
                            bcc {
                                #0 {
                                #   name = TYPO3-AMP Form (BCC)
                                #   email = typo3(at)coding(dot)ms
                                #}
                            }
                        }
                    }

                }
            }
        }
    }
}