You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue when trying to use the plugin.tx_powermail.settings.settings.setup.marketing.determineCountry = 1 setting to enable country information for my requests. Unfortunately, the feature doesn't work as intended, and after some debugging, I identified the root cause.
Steps to Reproduce:
Add the configuration plugin.tx_powermail.settings.settings.setup.marketing.determineCountry = 1 to enable the country detection.
Submit a form and check the marketing information stored in the database.
Notice that the country field is never populated with data from ip-api.com.
Findings:
The function initMarketingInfo (responsible for populating country information using ip-api.com) will never work as expected due to the following reasons:
The $settings array is always empty when initMarketingInfo is called.
This happens because initMarketingInfo is only called indirectly via the createAction method, and the createAction does not pass any settings down the call chain.
The call sequence is:
createAction -> saveMail -> prepareMailForPersistence -> getMarketingInfos -> initMarketingInfo
Since getMarketingInfos does not receive any arguments, it calls initMarketingInfo without arguments.
As a result, the isset($settings['setup']['marketing']['determineCountry']) condition always fails, and the fallback message "Country From IP is disabled." is used.
Additional:
The fallback message "Country From IP is disabled." (or its localized equivalent) is stored in the database in the frontend context language.
For instance, if a contact request is submitted in German, the message "Länderermittlung von IP Adresse ist deaktiviert." is saved to the database. This can confuse editors who expect a consistent language in backend data.
The text was updated successfully, but these errors were encountered:
I encountered an issue when trying to use the
plugin.tx_powermail.settings.settings.setup.marketing.determineCountry = 1
setting to enable country information for my requests. Unfortunately, the feature doesn't work as intended, and after some debugging, I identified the root cause.Steps to Reproduce:
plugin.tx_powermail.settings.settings.setup.marketing.determineCountry = 1
to enable the country detection.Findings:
The function
initMarketingInfo
(responsible for populating country information using ip-api.com) will never work as expected due to the following reasons:initMarketingInfo
is called.initMarketingInfo
is only called indirectly via thecreateAction
method, and thecreateAction
does not pass any settings down the call chain.createAction -> saveMail -> prepareMailForPersistence -> getMarketingInfos -> initMarketingInfo
Since
getMarketingInfos
does not receive any arguments, it callsinitMarketingInfo
without arguments.isset($settings['setup']['marketing']['determineCountry']) condition
always fails, and the fallback message "Country From IP is disabled." is used.Additional:
The fallback message "Country From IP is disabled." (or its localized equivalent) is stored in the database in the frontend context language.
For instance, if a contact request is submitted in German, the message "Länderermittlung von IP Adresse ist deaktiviert." is saved to the database. This can confuse editors who expect a consistent language in backend data.
The text was updated successfully, but these errors were encountered: