• Resolved gluleci

    (@gluleci)


    hello, i create a form and users select category. I use this code but not working.

    document.addEventListener( 'wpcf7mailsent', function( event ) {
      var categoryname = $('input[name="bultenkonusu"]:checked').val();
      var notification = $('input[name="frequency"]:checked').val();
    
    if(notification=="now") {
    
      console.log("about to initialize Signal"); 
      window.addEventListener('load', function() {
        window._oneSignalInitOptions.promptOptions = {
          slidedown: {
            prompts: [
              {
                type: "category",
                autoPrompt: true,
                text: {
                  /* actionMessage limited to 90 characters */
                  actionMessage: "Custom action message",
                  /* acceptButton limited to 15 characters */
                  acceptButtonText: "Yes",
                  /* cancelButton limited to 15 characters */
                  cancelButtonText: "No",
                  /* CATEGORY SLIDEDOWN SPECIFIC TEXT */
                  negativeUpdateButton:"Cancel",
                  positiveUpdateButton:"Save settings",
                  updateMessage: "Update your push notification subscription preferences.",
                },
                delay: {
                  timeDelay: 1,//seconds to wait for display
                  pageViews: 1,//# pageviews for prompt to display
                },
                categories: [
                  {
                   <strong> tag: categoryname,
                    label: categoryname,</strong>
                  }
                ]
              }
            ]
          }
        }
        window.OneSignal = window.OneSignal || [];
        window.OneSignal.push(function() {
          window.OneSignal.init(window._oneSignalInitOptions);
        });
      });
    
    }
    
    });
Viewing 1 replies (of 1 total)
  • Hi. Could you contact our support team at support@onesignal.com with a link to the page where this is not working?

    It’s difficult for us to troubleshoot based on just this code, but perhaps we can help if we can see the errors that are generated in the browser when it runs on your website.

Viewing 1 replies (of 1 total)
  • The topic ‘spefic category after contact form 7 on submit’ is closed to new replies.