Instant Emails & Digests sent only to members who can post

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Instant Emails & Digests sent only to members who can post

Coleen_Astalos
I would like to limit subscription emails to be sent only to those who are "Members" (ie. those that can post in my situation).

It looks like I can do this by changing the following two macros:
digest_email & should_get_instant_email to change the "can_view" to "can_post_under".  

So changing this in "digest email": <n.filter_by.local_subscription.user.can_view.current_node/>
to this: <n.filter_by.local_subscription.user.can_post_under.current_node/>

And changing this in should_get_instant_email: <n.local_user.can_view.page_node /> 
to this: <n.local_user.can_post_under.page_node /> 

Does that look right?  Will it mess anything else up?

Doing this solves my problem of having to find subscriptions for people who are no longer "Members"  and remove the subscription.  The subscription can stay out there it just won't generate an email or digest to them.  Then if they join again later (and get put back into the Members category) they'll start to get their subscriptions again.

Thanks,
Coleen
Reply | Threaded
Open this post in threaded view
|

Re: Instant Emails & Digests sent only to members who can post

Coleen_Astalos
I made this change and tested it and it seems to be working.  
I just need to make sure I haven't affect something else unexpectedly.
Your thoughts?
Coleen
Reply | Threaded
Open this post in threaded view
|

Re: Instant Emails & Digests sent only to members who can post

Pedro
It seems to work. But I think you should also remove the option "Subscribe via email" from these users menu, so as long as they are not members they won't be waiting for a digest they might have signed for.
What do you think?
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Instant Emails & Digests sent only to members who can post

Coleen_Astalos
Yes. Can you tell me how to do that? But, in my case they won't have access to my site if they're not a member.

Coleen Astalos
[hidden email]

"Pedro <Nabble> [via Nabble Support]" <[hidden email]> wrote:

It seems to work. But I think you should also remove the option "Subscribe via email" from these users menu, so as long as they are not members they won't be waiting for a digest they might have signed for.
What do you think?
My test forum.



If you reply to this email, your message will be added to the discussion below:
http://support.nabble.com/Instant-Emails-Digests-sent-only-to-members-who-can-post-tp7587368p7587419.html
To unsubscribe from Instant Emails & Digests sent only to members who can post, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: Instant Emails & Digests sent only to members who can post

Pedro
Ok. Go to your app_dropdown macro, and surround the subscription option like this:
<n.if.visitor.is_in_group group="Members">
	<then>
		<n.menu_subscription/> 
	</then>
</n.if.visitor.is_in_group>
<n.menu_post_by_email/> 
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Instant Emails & Digests sent only to members who can post

Coleen_Astalos
When I make this change I get this error:
Error 500

NAML exception in customized site: can't get visitor on cached page
        in visitor(custom_tweak:app_dropdown:8) - <n.if.visitor.is_in_group group="Members"> - public void nabble.view.web.template.ServletNamespace.visitor(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter) throws javax.servlet.ServletException
        in if(custom_tweak:app_dropdown:8) - <n.if.visitor.is_in_group group="Members"> - public static void nabble.naml.namespaces.BasicNamespace._if(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.Interpreter)
        in page_node(nabble:action_row.naml:91) - <n.page_node.app_dropdown/> - public void nabble.view.web.template.NodePageNamespace.page_node(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter)
        in options_action_menu(nabble:view_standard.naml:20) - <n.options_action_menu/>
        in nabble_html(nabble:utilities.naml:19) - <n.nabble_html> - public void nabble.view.web.template.ServletNamespace.nabble_html(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter)
        in html_impl(nabble:utilities.naml:4) - <n.html_impl>
        in html(nabble:app.naml:88) - <n.html>
        in do(nabble:utilities.naml:982) - <n.as_node_page.do/>
        in as_node_page(nabble:utilities.naml:982) - <n.as_node_page.do/> - public void nabble.view.web.template.NodeNamespace.as_node_page(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter)
        in do(nabble:utilities.naml:987) - <n.get_node_from_request_parameter.do/>
        in get_node_from_request_parameter(nabble:utilities.naml:987) - <n.get_node_from_request_parameter.do/> - public void nabble.view.web.template.ServletNamespace.get_node_from_request_parameter(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter) throws java.io.IOException,javax.servlet.ServletException,nabble.naml.namespaces.TemplateException
        in catch_exception(nabble:utilities.naml:986) - <n.catch_exception. id="get-node-block"> - public void nabble.naml.namespaces.BasicNamespace.catch_exception(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.Interpreter)
        in (nabble:view_standard.naml:5) - <subroutine name="view_standard" requires="basic,nabble,servlet">
        in view_standard(nabble:view_standard.naml:2) - <n.view_standard />
        in call_view_standard(nabble:app.naml:29) - <n.call_view_standard/>
        in call_view_forum(nabble:app.naml:4) - <n.call_view_forum/>
        in case(nabble:app.naml:3) - <n.case. value="forum"> - public void nabble.naml.namespaces.BasicNamespace$SwitchNamespace._case(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.Interpreter)
        in switch(nabble:app.naml:2) - <n.switch. value="[n.get_node_from_parameter.type/]"> - public void nabble.naml.namespaces.BasicNamespace._switch(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter)
        in (nabble:app.naml:1) - <macro name="view_app" requires="servlet,nabble,basic">

Message: NAML exception in customized site: can't get visitor on cached page

RequestURI: /

Server: n5.nabble.com
Caused by:

fschmidt.util.servlet.JtpContextServlet$JtpServletException: url=http://sudsol.1100894.n5.nabble.com/  user-agent=Mozilla/5.0 (Windows NT 6.0; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0 method=GET referer=http://sudsol.1100894.n5.nabble.com/template/NamlEditor.jtp
        at fschmidt.util.servlet.JtpContextServlet.handleException(JtpContextServlet.java:571)
        at fschmidt.util.servlet.JtpContextServlet.service2(JtpContextServlet.java:465)
        at fschmidt.util.servlet.JtpContextServlet.service(JtpContextServlet.java:332)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1360)
        at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:77)
        at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:144)
Reply | Threaded
Open this post in threaded view
|

Re: Instant Emails & Digests sent only to members who can post

Pedro
Make sure that the has been compiled. Sometimes a warning is showed saying "The source code below doesn't have navigation links because no usage has been compiled yet. Navigation links depend on how and where the macro is used, so first you may try finding all usages of 'MACRO_NAME'. " if so, find a use of it and enter the macro. Then, override it again.
My test forum.