Viewing 5 replies - 1 through 5 (of 5 total)
  • If you want to notify a certain usergroup when an attachment is added to a post, you could try something like https://gist.github.com/cojennin/31c877280c803d7cc747edd36ca3a7ef.

    This would (fingers crossed, haven’t tested it) notify all my copy editors that an attachment has been added to a post (the attachment is not necessarily an image!).

    Would something like that suffice? How do you see a notification on an image being uploaded to a post fitting into your current workflow?

    Thread Starter Philip Crumpton

    (@crumptoninc)

    Thank you for your response!

    That’s VERY close. The only thing I’d like to figure out is how to get the current post’s subscribed users or groups dynamically before sending instead of hard-coding the group.

    Thank you for the question about workflow. I’m building out a university’s student news site and they place a high emphasis on photo quality, thereby wanting notifications when photos are added to a post so it can be properly reviewed.

    Gotcha. Updated the gist: https://gist.github.com/cojennin/31c877280c803d7cc747edd36ca3a7ef

    That should grab all the user groups (note: it does not grab individually subscribed users) on the post and send emails to every individual in a user group that is subscribed to the post.

    It also checks to make sure the notifications and user groups modules are enabled. If one or the other is disabled, it won’t send notifications.

    edit: clarification

    Thread Starter Philip Crumpton

    (@crumptoninc)

    Awesome! Very appreciative of your help. This should get me going quite well.

    By the way, I couldn’t find documentation on the edit flow site (I did look!). Is there any formal documentation?

    Ooph. Caught red-handed.

    It’s something that definitely needs work. There’s a section on the website with code snippets for extending Edit Flow, but standard documentation is lacking.

    If you ever have a few minutes and wish to pay this one forward, would be great to have a PR to kick off the documentation process. Maybe just documenting one of the functions in that gist get_usergroup_by or get_following_usergroups.

    Bare bones, I’d imagine in Github the documentation structure might look like:

    - common
    - language
    - modules
    - tests
    - docs
      - edit_flow.md (documenting functions, their arguments, return values and use cases)
      - modules
        - notifications.md (documenting functions, their arguments, return values and use cases)
        - user-groups.md (documenting functions, their arguments, return values and use cases)

    But open to suggestions.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Image Upload Notification’ is closed to new replies.