Coder Social home page Coder Social logo

Comments (12)

picman avatar picman commented on August 14, 2024

Yes, it does. See the Wiki. You should call CustomWorkflowMailer.deliver_custom_email(issue.author, 'Subject', 'Body')

from redmine_custom_workflows.

piotrsz772 avatar piotrsz772 commented on August 14, 2024

I have an error like this

Workflow script executable before saving observable object contains error: undefined local variable or method issue' for #Issue:0x00005621e7d15ce0 Did you mean? @issue `

but when i use @issue not working

from redmine_custom_workflows.

picman avatar picman commented on August 14, 2024

What is the observable object? How about self.issue?

from redmine_custom_workflows.

piotrsz772 avatar piotrsz772 commented on August 14, 2024

Observable object is issue self.issue not working too

from redmine_custom_workflows.

piotrsz772 avatar piotrsz772 commented on August 14, 2024

image

from redmine_custom_workflows.

picman avatar picman commented on August 14, 2024

If the observable object is Issue, you can directly call its methods, so simply author instead of self.issue.author.

from redmine_custom_workflows.

piotrsz772 avatar piotrsz772 commented on August 14, 2024

Ok, it works for author issue but if i want to send email to selected email on the picture? There is a way?

image

from redmine_custom_workflows.

picman avatar picman commented on August 14, 2024

The first argument of the function must be a user. So you cannot sent an email to an email address but to a certain Redmine user only. As a workaround you can create a user with the given email address and then use them as the email recipient.

from redmine_custom_workflows.

piotrsz772 avatar piotrsz772 commented on August 14, 2024

Yeah I did this, it is very nice plugin and simple but need some time to understand :) Thank you very much for your help.

from redmine_custom_workflows.

piotrsz772 avatar piotrsz772 commented on August 14, 2024

How can I set for Body html value?

from redmine_custom_workflows.

fredsdc avatar fredsdc commented on August 14, 2024

I had a similar problem. Finally I used ActionMailer to build and send the mail out of Redmine constraints.

Where:
content_bh -> html of the body
content_bp -> text of the body
mail_to -> to
mail_cc -> cc
content -> subject
tags -> tags for which attachments to include, search in description

html_part = Mail::Part.new do
  content_type  'text/html; charset=UTF-8'
  body content_bh   
end

text_part = Mail::Part.new do
  body content_bp   
end

m=ActionMailer::Base.mail(
  from: User.current.mail,
  to: mail_to,
  cc: mail_cc,
  subject: content,
  body: '',
  content_type: "multipart/mixed"
)

self.attachments.select{|a| a.description.downcase.match?(tags.downcase)}.each do |a|
  m.attachments[a.filename]=File.read(a.diskfile)
end

m.part content_type: "multipart/alternative" do |p|
  p.html_part = html_part
  p.text_part = text_part
end

m.deliver_now

from redmine_custom_workflows.

picman avatar picman commented on August 14, 2024

You can use html_safe function:

recipient = User.find(9)
CustomWorkflowMailer.deliver_custom_email(recipient, 
                                          'Subject', 
                                          '<b>Body</b>'.html_safe)

from redmine_custom_workflows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.