Skip to main content
August 19, 2008
Question

CF Email Notifications

  • August 19, 2008
  • 5 replies
  • 290 views
Hi everyone,

I'm currently working on a work submissions system for our building
in which users input information (subject, urgency, status, etc.) into a
form to have various work done around the building. I need a way (if
possible) to create an email notification for the system. Something
where if the status was changed or a note was added then it would
email the employee who requested the work order as well as the
person assigned. This would notify them that their work order has
been changed and they need to check the system.

Any help with how to approach this would be appreciated, especially
code snippets. I can post code as well if it helps.

Thanks,
Eric
    This topic is closed to new replies. Start a new post to keep the conversation going.

    5 replies

    Inspiring
    August 20, 2008
    Depends on the details. You can take Ian's concept and apply it whenever a change is made, or you can run a scheduled job that look for changes and sends mail when it finds any.

    The fundamental principle is that you have to know what your code is supposed to accomplish before you start writing it.
    Inspiring
    August 19, 2008
    What part are you having difficulty with?
    August 19, 2008
    To be honest, I don't have any experience utilizing email within the apps I've been working on, so I don't really know how to approach the concept of integrating email notifications. The idea is that the system will send out an email when a change has been made to work orders in order to alert the user and assigned employee of the change.

    I'm sorry I can't be more specific but I just have no idea where to begin with this kind of integration I guess. Any ideas on how to do this?

    Thanks,
    Eric
    Inspiring
    August 19, 2008
    ethomas17 wrote:
    > To be honest, I don't have any experience utilizing email within the apps I've
    > been working on, so I don't really know how to approach the concept of
    > integrating email notifications. The idea is that the system will send out an
    > email when a change has been made to work orders in order to alert the user and
    > assigned employee of the change.
    >
    > I'm sorry I can't be more specific but I just have no idea where to begin with
    > this kind of integration I guess. Any ideas on how to do this?
    >
    > Thanks,
    > Eric
    >

    You pretty much have it laid out in high level terms there. Integrating
    the actual e-mail is as simple as adding an <cfmail...> tag.

    I.E. crude code example.

    <cfif statusChange IS true>
    <cfmail
    to="#data.requester#"
    from="my.Cool.System@yourCompany.com"
    subject="Status Change">
    The Status of your request #data.requestID# has changed to
    #data.statusValue#.
    </cfmail>
    </cfif>