• Resolved hellotrio

    (@hellotrio)


    First off, I love the plugin! I am aware that you do have an extension for Slack, but I am not interested in purchasing that at this time because I’m having no trouble setting up the the webhooks, except for this one issue with dates.

    I have Webhook Json notifications set up for various triggers. When I try to include dates though for all of the options I’ve tried, it saves correctly but in the debugging information and on Slack, it is not showing the date. Doesn’t matter what metatag I use, I’ve tried every option provided.

    Triggers I’ve used:

    • Post Published
    • Post Scheduled
    • Post Updated
    • Comment Added
    • Comment Published
    • User Login Failed

    I’d try more but I obviously have something set up wrong somewhere.

    Here is what the message looks like in Slack: https://ibb.co/56rgSNQ

    Here is the json I’m using for the “Post Scheduled” trigger notification.

    {
    	"blocks": [
    		{
    			"type": "section",
    			"text": {
    				"type": "mrkdwn",
    				"text": "{post_title} by {post_author_user_display_name}"
    			}
    		},
    		{
    			"type": "section",
    			"text": {
    				"type": "mrkdwn",
    				"text": "{post_excerpt}"
    			}
    		},
    		{
    			"type": "context",
    			"elements": [
    				{
    					"type": "mrkdwn",
    					"text": "*Updated by:* {post_last_editor_display_name}"
    				},
    				{
    					"type": "mrkdwn",
    					"text": "*Scheduled:* {post_publication_datetime}"
    				}
    			]
    		},
    		{
    			"type": "actions",
    			"elements": [
    				{
    					"type": "button",
    					"text": {
    						"type": "plain_text",
    						"emoji": true,
    						"text": "Edit"
    					},
    					"url": "https://ifatceg.com/wp-admin/post.php?post={post_ID}&action=edit",
    					"value": "click_me_123"
    				}
    			]
    		}
    	]
    }

    Here is the most recent try via the debugging:

    {
    	"blocks": [
    		{
    			"type": "section",
    			"text": {
    				"type": "mrkdwn",
    				"text": "Test Post by Kyle Boas"
    			}
    		},
    		{
    			"type": "section",
    			"text": {
    				"type": "mrkdwn",
    				"text": "*Excerpt:* This is an excerpt."
    			}
    		},
    		{
    			"type": "context",
    			"elements": [
    				{
    					"type": "mrkdwn",
    					"text": "*Updated by:* Kyle Boas"
    				},
    				{
    					"type": "mrkdwn",
    					"text": "*Scheduled:* "
    				}
    			]
    		},
    		{
    			"type": "actions",
    			"elements": [
    				{
    					"type": "button",
    					"text": {
    						"type": "plain_text",
    						"emoji": true,
    						"text": "Edit"
    					},
    					"url": "https://ifatceg.com/wp-admin/post.php?post=8235&action=edit",
    					"value": "click_me_123"
    				}
    			]
    		}
    	]
    }

    Any help would be appreciated! I’ve been at this for about 3 days searching for the answer.

    • This topic was modified 5 years, 2 months ago by hellotrio.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Kuba Mikita

    (@kubitomakita)

    Hi, that’s quite weird. I presume when you enable Email carrier and use the {post_publication_datetime} merge tag it also won’t print anything?

    Can you confirm you are using the correct merge tag? For example Post updated trigger doesn’t have the one you are using, but instead it has {post_creation_datetime} and {post_modification_datetime}

    Thread Starter hellotrio

    (@hellotrio)

    Hello, I didn’t try the email carrier option before but I just did and it produced the same result for the Post Updated trigger. No dates shown, blank. I used all of the merge tags you just mentioned before.

    Here is what I had in the body of the email I have set up in the settings:

    {post_modification_datetime}
    
    {post_creation_datetime}
    
    {post_publication_datetime}

    Here is the debugging information for the body after updating a post:

    
    
    {post_publication_datetime}

    Which of course that matches what was sent in the email. So the {post_creation_datetime} and {post_modification_datetime} are both blank in the email.

    I don’t know what would be causing the issue. I have another Slack notification plugin that works fine with dates so I don’t think it’s other plugins causing it. I was transitioning all of my notifications to your plugin because I prefer it but the dates are all that’s holding me back from deactivating the other plugin.

    • This reply was modified 5 years, 2 months ago by hellotrio.
    • This reply was modified 5 years, 2 months ago by hellotrio.
    • This reply was modified 5 years, 2 months ago by hellotrio.
    Plugin Author Kuba Mikita

    (@kubitomakita)

    I can see two places it can fail:
    – the post/comment/user date is corrupted in the database (not very likely)
    – the date and time format is corrupted so we cannot format the time

    Could you please check in WordPress Settings -> General if the date and time format is right and maybe save this page options?

    Also, is this a single site or multisite?

    Thread Starter hellotrio

    (@hellotrio)

    Thank you for that, it was the date and time format in the settings. I don’t know why I didn’t think to check that. I had it set to a custom format for both the date and time instead of the standard default setups. When I saved it it’s now sending the date and time!

    And I am using a multi-site, I should have mentioned that. Thanks for your help!

    Plugin Author Kuba Mikita

    (@kubitomakita)

    Awesome, I’m glad it helped!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Dates are not displayed –’ is closed to new replies.