Automatically Email Vendor on Approval of Purchase Order in IBM Maximo

Automate emails to vendors from approved purchase orders in Maximo CMMS

This article will walk an IBM Maximo administrator through the steps necessary to send a purchase order by email to a vendor as an attachment. It is a common requirement by customers to be able to automatically send the purchase order to vendors through email. Some of the benefits of doing this are:

  • Standardize the way that approved purchase orders are communicated to vendors. A common template can be used for the email subject and body, as well as a common workflow for when the communication is sent.
  • Reduce the time taken by procurement agents in generating reports, saving them locally, finding appropriate contact information, and typing up an email.
  • When IBM Maximo sends the email, a copy of the email that was sent is stored in the Communication Log along with the purchase order. If you ever need to know when the email was sent and to whom, the documentation of the email is in IBM Maximo attached directly to the purchase order. No more searching through email to find the communication.

To achieve this, we will deploy an automation script in IBM Maximo that will generate the report and send the email. Before we get to the script, we need to ensure that the following prerequisites are met:

  1. The email address of the vendor should be recorded in the Companies application on the Contacts tab. The script below will use the email address of the Primary Contact (set on the Addresses tab) but can be adjusted to include a larger or more targeted set of email addresses. However, they must be accessible from somewhere in the system by the script.
  2. A Communication Template should be created and activated to be used as the email subject and body of the communication. By default, I’ve named the template POTOVENDOR, but you can name it anything you want and change it in the script.
  3. A BIRT report that represents the purchase order to be sent to vendors. By default, the auto script uses the poprint.rptdesign report that comes with IBM Maximo. This can be changed in the script to a custom report but be sure to match up the report parameters if necessary.

The trigger point for the script below is a status change of the purchase order to APPR. However, this could just as easily be triggered from IBM Maximo workflow, escalations, or other means.

Here is the automation script needed to make this happen:

from com.ibm.tivoli.maximo.report.birt.queue import ReportQueueService
from com.ibm.tivoli.maximo.report.birt.runtime import ReportParameterData
from psdi.mbo import SqlFormat

# Get the current user's information
userInfo = mbo.getUserInfo()
locale = userInfo.getLocale()

# If the PO Vendor does not have a contact with email, then kindly exit
if not mbo.isNull("VENDOR.PRIMARYCONTACT.EMAIL"):
    emailTo = mbo.getString("VENDOR.PRIMARYCONTACT.EMAIL")
    # Append the current user's email address to the chain to ensure delivery
    if userInfo.getEmail() and not userInfo.getEmail() == "":
        emailTo = emailTo + ", " + userInfo.getEmail()
    
    # Create default message subject and body
    # These will be replaced by a communication template if one is found by the code below
    emailSubject = "Purchase Order"
    emailComments = "Please acknowledge receipt of this Purchase Order."
    
    # Change this value to a valid Maximo Communication Template ID
    commTemplateID = "POTOVENDOR"
    
    # Get the communication template
    commTemplateClause = SqlFormat(mbo, "templateid = :1")
    commTemplateClause.setObject(1, "COMMTEMPLATE", "TEMPLATEID", commTemplateID)
    commTemplateSet = mbo.getMboSet("$potovendor", "COMMTEMPLATE", commTemplateClause.format())
    commTemplateMbo = commTemplateSet.getMbo(0)
    if commTemplateMbo:
        # Build the email subject and body from the Communication Template
        sql = SqlFormat(mbo, commTemplateMbo.getString("SUBJECT"))
        sql.setIgnoreUnresolved(True)
        emailSubject = sql.resolveContent()
        sql = SqlFormat(mbo, commTemplateMbo.getString("MESSAGE"))
        sql.setIgnoreUnresolved(True)
        emailComments = sql.resolveContent()
    
    # Build the Report Parameters
    parameterData = ReportParameterData()
    parameterData.addParameter("appname", "PO")
    parameterData.addParameter("paramdelimiter", "")
    parameterData.addParameter("paramstring", "")
    parameterData.addParameter("where", "(po.poid = " + str(mbo.getLong("POID")) + ")")
    
    # Queue the Report to Run
    queueManager = ReportQueueService.getQueueService()
    queueManager.queueReport("poprint.rptdesign", "PO", userInfo.getUserName(), emailTo, emailSubject, emailComments, parameterData, locale.getCountry(), locale.getLanguage(), locale.getVariant(), userInfo.getTimeZone().getID(), userInfo.getLangCode(), long(0), userInfo)

Related posts

7 comments

  • I have run this script and I can see the email with a report. But , the communication log of PO can’t be created. So, Could you please tell me which part of script is used to create the communication logs?
    thanks,

  • JULIO L HERNANDEZ

    Hi Alex,

    Is that the entire Automation Script above? I don’t see a vertical scroll bar and the last line I see starts with “queueManager.queueReport(“.

    I can see how you’re retrieving the CommTemplate but I don’t see how you’re creating a CommLog or how the report is being attached to the CommLog.

    Thanks.

  • Hi Alex,

    Works perfect for me. Great stuff.
    A question: Is it possible to open an outlook mail for preview?
    Sometime you would need to add or modify the participants list or add special notes
    to the template before it’s being send to the vendor.

  • I’m embarrassed to ask, but some vendors still want to use fax. How do you handle this?

    • Alex Walter

      There are some good email-to-fax or text-to-fax services out there. Haven’t tried them myself, but those would likely be your best option.

  • Adam Ames

    Hi Alex, I am trying to implement this as we have a request for it. Everything appears to work and I see it in the reportrunparam and reportrunqueue tables but nothing ever gets emailed.

    • Alex Walter

      Ultimately the email will be sent from the REPORTSCHEDULE cron task, even though it will be queued to run immediately. Make sure that Admin Mode is off and that the cron task is able to run (e.g. check the mxe.crontask.donotrun and mxe.crontask.dorun variables). Also, check the report itself and/or the parameters that you are passing to it. Hope that helps.

Michael Woline

Technology Project Manager (PMP 2009-18) with 15 plus years’ experience building, migrating, and upgrading enterprise applications including Maximo and Peoplesoft. Industries include banking, insurance, and publishing. Career began as a developer writing code and SQL because solving puzzles and figuring out how things works is fun. For fun I used to kite board on the beach, and have resumed cycling with a goal of riding some of the routes of the Giro d'Italia and Tour De France.

Nick Bonfiglio

Hi, I'm Nick! I am relatively new to Maximo, but I've been working in the software and IT space for a good stretch of my career. Most of that time I’ve spent as a QA Engineer at a SaaS company, so I'm no stranger to the technical side of things. Outside of work, I spend most of my time with family. I enjoy cooking and trying out new recipes whenever I get the chance, most of all I love cooking on a good grill! Living in Florida, I take full advantage of the beach as much as I can. I like to keep things pretty simple just good food, family, and some sun!

Akilah

Hi, I’m Akilah! I work with Maximo and come from a background in Computer Engineering, where I picked experience with SQL, Python, and general IT troubleshooting (aka figuring out why things break and how to fix them). I also served as a communications lead during my senior capstone, which helped me get comfortable collaborating with teams and keeping things moving.

Chad

Chad started his CMMS and EAM solutions consulting career in the late 20th century. The past twenty-three years have primarily been focused on supporting Maximo in Life Sciences, Oil & Gas, Government facilities, and Manufacturing verticals. Chad especially enjoys discussions regarding logistics, inventory management, and process improvement. In his free time, he enjoys hunting, fishing, playing guitar, maintaining his small farm, and spending time with his family.

Mike

Mike is a jack-of-all-trades IT professional with 20+ years in manufacturing, starting as a Help Desk temp and working his way through admin, engineering, management, and architect roles. He loves solving problems and building tools to make work easier—Maximo gives him plenty of chances to do both. In his free time, Mike enjoys woodworking, the outdoors, playing synths and hand drums, reading, and learning. Given his druthers (whatever those are), he'd build a timber-framed cabin on 40+ acres of mixed hardwood forest for his future grandkids to work for free play in.

Shane

Maximo Analyst

With a background in Computer Science and Cybersecurity and a CompTIA Security+ certification, I bring both a technical foundation and a curiosity-driven mindset to everything I do. Since joining the industry, I’ve gained hands-on experience with IBM Maximo, including scripting, BIRT reporting, Maximo customization, configuration, and supporting long-term client projects. I've also attained my MAS8 certification. I’ve had the opportunity to work closely with clients, troubleshoot complex issues, and contribute to impactful system enhancements—all while continuously learning and growing in the field. I approach challenges with determination, thrive in collaborative environments, and enjoy finding creative solutions. Outside of work, I recharge by spending time with family and friends, playing video games, staying active, and experimenting in the kitchen.

Maximo Application Suite

Accelerated Time to Value
Lower Total Cost of Ownership
Scalable, Integrated Platform
Continuous Innovation & Updates

Visual Inspection

Accelerate Defect Detection
Flexibility to Train and Deploy
Increase Uptime 24/7 Real Time Monitoring
Better Worker Safety

Monitor

Enterprise Level Data Aggregation
Scaled Operations
AI Deductions
Advanced Root Cause Analysis

Predict

Condition Based Maintenance
Lower Costs
Better Asset Availability
Reduced Risk

Manage

Comprehensive View of Assets
Understand Resource Attributes, Configuration and Relationships
Drill Down View

Health

Improve Reliability
Performance Insight
Better Planning
Clean Data
Optimization – Data, Costs, Risks

Mobility

Boost Productivity
Safer Workplace
Reduce Knowledge Gaps
Avoid Downtime

Maximo Assist

AI-Powered Troubleshooting & Guidance
Faster Issue Resolution in the Field
Knowledge Capture & Reuse Across Teams
Smarter Decisions with Contextual Insights

Dexter

Maximo Analyst

Dexter began his career in the warehouse field. Developing his skills in inventory control, accounts payable, shipping, and receiving, and procurement. While working at Apex he was learning the Maximo system in and out. Eventually learning it so well he taught everyone how to use it. Eventually becoming a system administrator for the Apex site.

A fun fact about Dexter is that he was an Elvis impersonator for 24 years. He enjoys singing, fishing, golf, and playing pool. He's an avid movie buff, most likely you'll find him watching the latest movie.

Chip

Client Relations Specialist

Chip is new to Maximo but has worked for various software companies through his career in both a sales and client relations role. In his spare time, Chip likes to golf, travel and work on projects around the house, especially those with an artistic touch. He is also up for any type of competition whether that be playing cards, board games or recreational sports.

Sarah

Maximo Analyst

Sarah is a recent graduate starting her asset management career. She counts fast learning and determination as key skills that she’s applying to become an Maximo pro! Sarah’s background in IT Services and studies in computer science have strengthened her natural problem-solving skills and desire to help others through technology. In her free time, Sarah enjoys baking, sewing, reading comic books, and building her own video game.

Vishal

Maximo Analyst

Hey there! I’m a Maximo Developer with hands-on experience working across IBM Maximo 7.5.x, 7.6.x, MAS 8, and MAS 9. My focus is mainly on database administration, system integrations, automation scripting, UI customizations, and Maximo admin tasks like BIRT reporting and migration management. I’ve also dabbled in integration work and enjoy finding smart, efficient solutions to everyday challenges in Maximo.

When I’m not working, you’ll probably find me gaming on my PS5 over the weekend or exploring the latest tech trends to keep myself up to speed.

Xavier Galarza

Maximo Analyst

I'm a motivated and curious professional with hands-on experience across multiple Maximo projects, including leading several initiatives. My goal is to continue deepening my expertise in Maximo so I can guide others in unlocking its full potential. I am also fully certified in MAS8. With a strong background in development and a natural problem-solving mindset, I enjoy tackling challenges and learning from those around me. I'm passionate about continuous improvement—both technically and personally—and thrive when I'm surrounded by talented, knowledgeable peers. Outside of work, I enjoy playing video games, watching sports, and staying active with pickleball.

Courtney LeBlanc

Business Analyst

Courtney is a polished Maximo consultant with over 10 years working in the industry. She has worn many hats including QA Specialist, Trainer, Functional Lead, Project Lead and Business Analyst. A point of great professional pride for Courtney is helping clients meet their needs and realize the power of their investment. Being a part of the process that helps clients learn how to use their system and get the most out of it is a great feeling at the end of the day.

Bob Richardson

VP of Products (Ninja)

Bob leads A3J Group’s operational services and heads up our Maximo Ninja product line. With over 50 successful Maximo projects under his belt and MAS 8 certifications in both functional and technical tracks, Bob brings deep experience and steady leadership to every engagement. He has played a key role in the development of many of A3J Group’s most advanced solutions.
Outside of work, Bob enjoys traveling with his wife, spending time outdoors, and occasionally pondering life’s mysteries from his garage—possibly while thinking about squirrels.

Kelly Nimmo

VP of Products (MxMobile)

Kelly Nimmo leads A3J Group’s product development and serves as a senior analyst and consultant with over 14 years of IBM Maximo experience. She is a co-architect and lead developer of MxMobile, our flagship mobile solution, and holds MAS 8 certifications in both functional and technical disciplines. Known for blending technical depth with practical insight, Kelly plays a key role in designing and delivering innovative Maximo-based tools. Outside of work, she enjoys fishing the Florida waters and teaching soccer skills—like the “around the world”—to her nieces and nephews.

Kim Walter

COO

Kim began her career in Investment Banking in the Biotech and Tech sectors. After leaving banking, she focused on executive strategic development evolving her business building skills. Co-founding A3J Group was a natural fit with the idea of creating a fierce ninja style unit that outperforms all others. In her free time, she is training for her next eventing competition or studying to become a Master of Wine or practicing her tornado kick. She could be with her family hiking or surfing or cooking. But she’s definitely not sitting around doing nothing.

Alex Walter

CIO

Alex brings 18 years of Maximo/EAM consulting experience in Life Sciences, Oil & Gas, Water/Waste Management, Government facilities, and much more. He has been awarded the honor of IBM Champion from 2018-2021, and is the brainchild behind our revolutionary mobile solution MxMobile.

In his free time he buys camping gear, enjoys a good circular saw and spends time with his family hiking, surfing and being outdoors.

Enhancement

• Configuration
• Integration & data loading
• Report improvement
• Screen view & workflow changes

Sustainability

• Report
• Troubleshoot
• Learn
• Teach
• Lead

Change Management

• Advanced systematic improvements
• Tailored procedure implementation
• Script-, report-, and application-level source and document control through Git repository software
• Training on how to document and deploy changes

Monitoring

• Active monitoring of your IBM Maximo system’s heartbeat
• Triggered notifications and support tickets when Maximo is not responding
• Automated Escalations based on the health of various critical background processes.
• Periodic and quarterly scheduled system health checks

System Support & Trouble Shooting

•On Demand Support
•Advanced Troubleshooting
•Access to A3J Group’s Maximo Support Environment to submit trouble tickets
•Directly report bugs, request fixes and enhancements

System Patching & Environment Refreshes

• Tentative, bi-annual feature pack releases from IBM
• Minor patches (defined by the last number in the version model)
,• Quarterly lower environment refreshes

Admin

MxAsk

Create new self-service requests in a wizard-style format, and view the details of their open service requests.

MxApprove

Accept, reject, and reassign assignments, review assigned records, and view your workflow inbox.

MxMobile

A suite of mobile applications designed to integrate with IBM Maximo Asset Management. These apps modernize workflow, expedite inventory processes, reduce time spent on data entry, and more.

Workflow

MxMeter

View and enter meter readings, view trends in graphical format, and create readings while in offline mode.

MxAsset

Scan barcodes and view maintenance facts. Create meter readings, work orders or service requests. Toggle asset downtime.

MxWork

Create new work orders on the go, view existing work orders and attachments, and capture fingertip electronic signatures.
0