Skip to main content
Solved

Custom event not working


Forum|alt.badge.img+2

I have created a custom event form 

but it’s not working on button click here is the code 

 

document.addEventListener("DOMContentLoaded", function(event) {
    $(".klaviyo_submit").click(function() {
        var _learnq = _learnq || [];
        _learnq.push(['track', 'Send Postcard from website', {
            'to_email': $('#postcard_email').val(),
            'to_name': $('#postcard_to_name').val() + " " + $('#postcard_to_last_name').val(),
            'from_email': $('#postcard_from_email').val(),
            'from_name': $('#postcard_img_from_first_name').val(),
            'from_first_name': $('#postcard_img_from_last_name').val(),
            'image_url': $('#postcard_img').val(),
            'caption': $('.postcard-section .postcard-content-title-caption p').text(),
            'message': $('#postcard_msg').val(),
            'first_name_upper': $('#postcard_to_name').val().toUpperCase(),
            'from_name_upper': $('#postcard_img_from_first_name').val().toUpperCase() + " " + $('#postcard_img_from_last_name').val().toUpperCase(),
            'postcard_number': $('.postcard-content-number').text().replace('\n< Nº ', '').replace(' >\n', ''),
            'first_name': $('#postcard_to_name').val(),
            'title': $('#postcard_title').val(),
            'from_first_name_upper': $('#postcard_img_from_first_name').val().toUpperCase()
        }]);

    });
});

Here is the link of form, click on send postcard 

https://www.smrdays.com/blogs/postcards/theodoros-zeta-montpellier-france

Best answer by Omar

@Taruuunnn even though you could probably change this some way or another you are aware that there are many laws and regulations in place that make sending unsolicited emails illegal? 

Anyway, my suggestion would be to send the use this card so they can send it to their friends themselves.

 

Regards,

Omar Lovert // Polaris Growth // Klaviyo Master Platinum Partner

We help with e-commerce growth through CRO, Klaviyo and CVO

View original
Did this topic or the replies in the thread help you find an answer to your question?

3 replies

Brian Turcotte
Forum|alt.badge.img+37

Hi @Taruuunnn!

 

If I understand your use case correctly, it seems that when someone fills out the form, it triggers an event which then initiates a "Postcard Flow".

 

The issue you’re experiencing most likely comes down to the fact that Flow messages can only be sent to the email address of the person who filled out the form. Klaviyo can't send it to anyone else's email because of compliancy rules - we need to make sure we have their consent to send emails to their email address.

 

So, even if someone enters another email in the "to_email" field you have there, the email will still only be sent to the person that fills the form because the event is associated with their email and profile.

 

I hope this helps to clarify, and thanks for using the Community!

- Brian


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 1 reply
  • March 2, 2023

Hii 
Thanks , this is what I was looking for 

So it’s not possible with klaviyo ?
if yes what is the way ?


Omar
Partner - Platinum
Forum|alt.badge.img+46
  • 2025 Champion
  • 494 replies
  • Answer
  • March 4, 2023

@Taruuunnn even though you could probably change this some way or another you are aware that there are many laws and regulations in place that make sending unsolicited emails illegal? 

Anyway, my suggestion would be to send the use this card so they can send it to their friends themselves.

 

Regards,

Omar Lovert // Polaris Growth // Klaviyo Master Platinum Partner

We help with e-commerce growth through CRO, Klaviyo and CVO