Select the search type
  • Site
  • Web
Search
You are here:  Support/Forums
Support

Bring2mind Forums

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 01/20/2006 11:57 PM by  Peter Donker
Calling DMX's Email Subscriber method
 7 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Jason K
New Member
New Member
Posts:12


--
01/18/2006 5:14 PM

    I have a tool that updates DMX by adding / updating the record via DMX's stored procedures.  The problem is that DMX is not aware of the update, so it does not send an email to subscribers.

    First, how can I effectively call DMX's method to send an email to subscribers when a record is updated?

    Second, do you have any recommendations on a better method of shaing info between DMX and another tool?

    Thanks,
    Jason

    Peter Donker
    Veteran Member
    Veteran Member
    Posts:4536


    --
    01/18/2006 11:08 PM
    For notification to go out you use the following:

    Bring2mind.DNN.Modules.DMX.Services.NotificationController.Notify(Me.ModuleConfiguration, Entry, Operation, Addressee) which calls:

    Public Shared Sub Notify(ByRef ModuleConfig As ModuleInfo, ByRef Entry As EntriesInfo, ByVal Operation As String, ByRef Addressee As DotNetNuke.Entities.Users.UserInfo)

    Note that the operation corresponds to a valid logging operation (check DMX_LogTypes). Similarly, you can add a log by calling:

    Bring2mind.DNN.Modules.DMX.Services.LoggingController.Log(Entry, Operation)

    This will add it for the current user. In your case you will want to use 'Add' for operation in both cases.

    About your second question: I'm not sure what it is you're asking. Sharing info is easily done through the data provider. There are more sophisticated methods available throughout the module, but it all depends on your application what is best for you. If you just need to plug a file every now and then, then what you're doing is fine.

    Peter


    Jason K
    New Member
    New Member
    Posts:12


    --
    01/19/2006 8:04 PM
    Thanks, Peter.

    I also found this method: Bring2mind.DNN.Modules.DMX.Controls.PortalModuleBase.LogAndNotify(ref EntriesInfo Entry, string Operation, ref DotNetNuke.Entities.Users.UserInfo Addressee)

    Would something like this work?



    using DotNetNuke.Entities.Users;
    using Bring2mind.DNN.Modules.DMX.Business;

    public class ViewCategory : Bring2mind.DNN.Modules.DMX.Controls.PortalModuleBase
    {
    private void Page_Load(object sender, System.EventArgs e)
    {
    EntriesInfo myEntry = null;
    EntriesController myController = null;
    int collectionId;

    collectionId = Request["cID"];

    UserController allUsers = new UserController();
    UserInfo addressee = allUsers.GetUser(this.PortalId,3);


    myController = new EntriesController();
    myEntry = myController.GetEntries(collectionId, this.PortalId);

    this.LogAndNotify(ref myEntry, "Add", ref addressee);
    }
    }
    Peter Donker
    Veteran Member
    Veteran Member
    Posts:4536


    --
    01/19/2006 8:37 PM
    There is one hitch: PortalModuleBase is the base class of the pages of DMX. When doing a 'log and notify' it takes the current module's config and sends it to the notification controller. The result is that the url back to the document will be fine (i.e. with correct TabId and ModuleId). If you come from another module, you therefore cannot use this class without risking false references ...

    Peter
    Jason K
    New Member
    New Member
    Posts:12


    --
    01/20/2006 7:01 PM
    My goal is to create an aspx page that will send a DMX notification email baseded upon the EntryID I send it as a querystring parameter. With that, you're right, I won't have the current module's config. Ideally, the emails would be sent by a support user we set up. Suggestions?
    Peter Donker
    Veteran Member
    Veteran Member
    Posts:4536


    --
    01/20/2006 8:10 PM
    Probably you're best of using

    Public MustOverride Sub Notify(ByRef PortalSettings As DotNetNuke.Entities.Portals.PortalSettings, ByVal SendingModule As DotNetNuke.Entities.Modules.ModuleInfo, ByRef Entry As Bring2mind.DNN.Modules.DMX.Business.EntriesInfo, ByVal Operation As String, ByRef Sender As Object, ByRef Addressees As ArrayList)

    from the NotificationProvider. The moduleinfo must be from an accessible DMX module to retrieve the correct url from. The operation is one from the permitted list, the sender is a UserInfo. The addressees is an arraylist of userinfos and optional. If left out the list is taken from all those subscribed to the entry.

    Hope this helps ...

    Peter

    Jason K
    New Member
    New Member
    Posts:12


    --
    01/20/2006 9:30 PM
    Ok. Thx. I can create a DNN User easily enough. for the How do I instantiate the Entry for the DMX entry I need? (hoping for a nice constructor that takes EntryID as parameter

    Peter Donker
    Veteran Member
    Veteran Member
    Posts:4536


    --
    01/20/2006 11:57 PM
    That is really really simple:

    Dim objEntries as New EntriesController
    Dim objEntry as EntriesInfo = objEntries.GetEntries(EntryId, PortalId)

    Remember that DMX data is portal-wide, so this becomes pretty simple. You don't have to contend with finding a particular module.

    Peter
    You are not authorized to post a reply.