• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Is e-mail sending?

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rafael,
When a user posts a comment, the system should send a e-mail to all users of that topic, but it isn't sending :?
I realized that the addresses are not being populated in the array


It's size is 0
But all users have a e-mail address in the database.

Where do you set the adresses?
I didn't find :x

Thanks
[originally posted on jforum.net by andre_a_s]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See net.jforum.view.forum.PostVH, method insertSave(). There is a call to



the tm.notiftUsers() method is the one who gets the users to send the notification email.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your answer,

I found the code.

I add this line

System.out.println("TopicModel:"+user.getUsername()") :

in the methode notifyUsers(...), loop while

----------------------------
...
while(rs.next()) {

User user = new User();

user.setId(rs.getInt("user_id"));
user.setEmail(rs.getString("user_email"));
user.setUsername(rs.getString("username"));
user.setLang(rs.getString("user_lang"));

users.add(user);
System.out.println("TopicModel:"+user.getUsername());
}
...
---------------------------

Unfortunatly, it always print only the name of the last user.

May be the SQL query indexed by "TopicModel.notifyUsers" is not correct ?

Thanks
[originally posted on jforum.net by Anonymous]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Anonymous wrote:
May be the SQL query indexed by "TopicModel.notifyUsers" is not correct ?

Thanks



Maybe. Get the sql in WEB-INF/config/database/generic/generic_queries.sql and execute it directly in the mysql console.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have the same problem.

When a message is posted, only the last user who post a message receive a mail.
I think the reason is that tm.notifyUsers(t) return an ArrayList whith only the last user.

So where this ArrayList is populated?

Thanks.
[originally posted on jforum.net by JoeLafousse]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

JoeLafousse wrote:Hi,

I have the same problem.

When a message is posted, only the last user who post a message receive a mail.
I think the reason is that tm.notifyUsers(t) return an ArrayList whith only the last user.

So where this ArrayList is populated?

Thanks.



In net.jforum.drivers.generic.TopicModel#notifyUsers

You can see the source here:

https://jforum.dev.java.net/source/browse/jforum/src/net/jforum/drivers/generic/TopicModel.java?rev=1.10&content-type=text/vnd.viewcvs-markup

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rafael Steil wrote:

Anonymous wrote:
May be the SQL query indexed by "TopicModel.notifyUsers" is not correct ?



Maybe. Get the sql in WEB-INF/config/database/generic/generic_queries.sql and execute it directly in the mysql console.



After several test, the conclusion is that the quesy is... false
[originally posted on jforum.net by Anonymous]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Where can I fin the Relational database schema ? I wil try to correct the query.

Thanks.
[originally posted on jforum.net by JoeLafousse]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

JoeLafousse wrote:Hi,

Where can I fin the Relational database schema ? I wil try to correct the query.

Thanks.



WEB-INF/config/database/mysql ( or any other subdirectory, depending the database you're using ).

Rafael
[originally posted on jforum.net by Rafael Steil]
 
He does not suffer fools gladly. But this tiny ad does:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic