Support » Plugin: Notifications Center » Almost Multilingual (WPML)

  • Resolved zemunelo

    (@zemunelo)


    Hello author,
    you have very good plugin. I am testing it and it is working well. I don’t see a reason not to go v1.0.
    Now, because email are custom posts as I can see, it is almost multilingual ready.
    Almost but not.

    I am testing the plugin in my new multilingual site (3 languages) and here is what I need:
    I will have a partners (role) who can submit new custom post (as draft). Admin will review and publish the post. WP and my theme will not send emails to notify anybody. Plugin will.

    I tried and it is working when partner submit draft, the email will go to admin.
    When admin publish post the email will go to author (partner). Everything is ok.
    But I have 2 more languages and whenever I translate original post a new email will go to author because it is publish function as well. So he will get 3 emails instead of 1.

    I see WPML can find your emails and translate them. But than if have translated version of email that will be sent too.

    Is there a way to quickly solve this problem?
    A function code to use…

    I have translated the slugs of the post type but when making new email no translated slugs to choose in settings.
    Or maybe to include tags in settings. That is also good idea.
    Or just for beginning to restrict only on main site language emails to be sent.

    I am not programmer but I can read and find the code. A few changes here and there. If you can give me some code to test I will gladly do it for you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Florian Chaillou

    (@ninadjeret)

    Hi Zemunelo,

    Thank you for your message and your support. I’m working to fix the problem you noticed when translating posts. I’ll get back to you as soon as possible.

    Thanks,
    Florian

    Plugin Author Florian Chaillou

    (@ninadjeret)

    Hi Milan,

    Here is the little snippet to prevent notification sending when WPML duplicates posts. You just need to add it to your functions.php file.

    /**
     * Block email sending for post translations using WPML
     * When WPML is about to duplicate post, we add a filter to prevent Notifications Center to send any email
     * 
     * @update 2016-12-18
     */
    add_action( 'icl_before_make_duplicate', 'prefix_add_notificationscenter_filter_for_wpml', 10, 2 );
    function prefix_add_notificationscenter_filter_for_wpml( $master_post_id, $lang ) {
        add_filter( 'voynotif/notification/sending/auth', 'prefix_block_wpml_translated_posts_2', 10, 2);
    }
    function prefix_block_wpml_translated_posts_2( $status, $notification ) {
        return false;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Almost Multilingual (WPML)’ is closed to new replies.