Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • curtismccaw 28 posts 88 karma points
    Feb 21, 2024 @ 13:00
    curtismccaw
    0

    Send For Approval

    Hi, When a user saved content and clicked to 'Send For Approval'. Who gets these requests to approve the content?

    I can't find any documentation on this.

    Many thanks

  • Kevin Jump 2343 posts 14890 karma points MVP 8x c-trib
    Feb 21, 2024 @ 13:39
    Kevin Jump
    100

    Hi,

    They are sent to accounts where notifications have been setup on the nodes.

    See https://docs.umbraco.com/umbraco-cms/tutorials/editors-manual/tips-and-tricks/notifications/

    but essentially if you set up notifications on the root content item, you would get sent the notifications for all send for approval requests.

    you also need to have the emails settings setup or it doesn't appear. (i think)

    https://docs.umbraco.com/umbraco-cms/extending/health-check/guides/smtp

  • curtismccaw 28 posts 88 karma points
    Feb 21, 2024 @ 14:56
    curtismccaw
    0

    Hi Kevin,

    Thanks, that's worked well.

    Do you know if it's possible to include what has changed in the notification?

    Many thanks

  • Kevin Jump 2343 posts 14890 karma points MVP 8x c-trib
    Feb 21, 2024 @ 16:20
    Kevin Jump
    0

    Hi,

    I don't think you can (Simply!). the text for the email is taken from the language files (so you can update that if you put your own language file in config/lang/en-us.xml) .

    https://github.com/umbraco/Umbraco-CMS/blob/contrib/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml#L1241

    but it really it just has below, and the method that calls it doesn't pass any details of the change.

     Hi %0%
    
          This is an automated mail to inform you that the task '%1%'
          has been performed on the page '%2%'
          by the user '%3%'
    
          Go to http://%4%/#/content/content/edit/%5% to edit.
    
          %6%
    
          Have a nice day!
          Cheers from the Umbraco robot
    
  • Mike B 9 posts 79 karma points
    Apr 26, 2024 @ 07:08
    Mike B
    0

    Hi Kevin,

    Is there a way to make a custom "trigger" for Send for approval?

    I've already made a

        public void Handle(ContentPublishedNotification notification)
    

    But this only triggers when doing "SaveAndPublish" not when i do "Send for approval"

    The only thing i find is this example on setting notification on the nodes themself, but this would only send the noti, to the email specified, but i wanna make it more dynamic, being able to send it for more than on user like my other "Handle".

    BR Mike

  • Kevin Jump 2343 posts 14890 karma points MVP 8x c-trib
    Apr 26, 2024 @ 07:12
    Kevin Jump
    1

    Hi

    I actually think its.

    ContentSendingToPublishNotification and ContentSentToPublishNotification that fire when send for approval is used.

    not 100% sure but i would try them.

  • Mike B 9 posts 79 karma points
    Apr 26, 2024 @ 07:37
    Mike B
    0

    Hi Kevin,

    Awesome, took me a few to figure out, but i was able to make a new class with ContentSentToPublishNotification

    (ContentSendingToPublishNotification didn't trigger for me)

    with my code looking like this (if anyone else have the same problem)

    public class SendToPublishModel: INotificationHandler<ContentSentToPublishNotification>
    {
    public SendToPublishModel()
    {
    }
    public void Handle(ContentSentToPublishNotification notification)
    {
        var id = notification.Entity.Id; // Test to get the right id - implement other code here
    }
    }
    

    And added it to Program.cs .AddNotificationHandler<ContentSentToPublishNotification, SendToPublishModel>()

    Thanks alot!

  • curtismccaw 28 posts 88 karma points
    May 09, 2024 @ 11:48
    curtismccaw
    0

    Hi guys,

    Our initial default solution worked for a while but we've stopped receiving notifications for 'send for approval' requests. Any suggestions on how to manage this. The custom solution above looks like it may work?

Please Sign in or register to post replies

Write your reply to:

Draft