Extend powermail forms with a checkbox for a newsletter subscription.
- Install the extension
- Add following code to your site packages
Services.yamlto register the connector.
services:
Undkonsorten\PowermailSubscription\Connector\ConnectorInterface:
class: 'Undkonsorten\PowermailSubscription\Connector\RegisteraddressConnector'- Add TypoScript to register the finisher in powermail and configure the needed properties and fieldnames.
plugin.tx_powermail.settings.setup {
finishers {
25 {
class = Undkonsorten\PowermailSubscription\Finisher\SubscriptionFinisher
config {
additionalProperties {
# AddressProperty = fieldname
firstName = firstname
lastName = lastname
}
subscriptionField = newsletter_subscription
consentField = newsletter_consenttext
# save address in pid
pid = 138
}
}
}
}
- Clear the cache
If you need another connector, implement the Undkonsorten\PowermailSubscription\Connector\ConnectorInterface
in your own Connector Class and define what you need in the subscribe method.