I want to test both subjects and CTAs (Call to Action) on emails using Split.
As I couldn't use the same helpers we use on views. I made this approach:
experiment = Split::Experiment.find_or_create 'Feedback CTA', t('registration_mailer.after_event.cta1'), t('registration_mailer.after_event.cta2'), t('registration_mailer.after_event.cta3')
@trial = Split::Trial.new(experiment: experiment)
@trial.choose!
Then in the view I just use @cta_text of course and send that value as a param in the link on the CTA.
To mark a conversion I went to the controller and made this:
cta_trial = Split::Trial.new(:experiment => Split::Experiment.find("Feedback CTA"))
cta_trial.alternative = params[:cta]
cta_trial.complete!
It seems to be working thou I'm not convinced if it's the correct or best way to do it.
Any thoughts on this? Should I have problems also with different locales?
Thanks