siefkenj / MailMergeP

Mail Merge P add-on for Thunderbird
GNU General Public License v3.0
16 stars 3 forks source link

[BUG] Does not recognizes csv fields with numbers #26

Closed onlycparra closed 2 years ago

onlycparra commented 2 years ago

my csv:

email,name,score,comments
"a@b.c","John",10.8,"<ul><li>comment 1</li></ul>"

My email:

to: {{email}}
subj: some title
body:
Hello {{name}}, you got {{score}} in this test.
Comments: 
{{comments}}
Best,
Me

I obtain the final body text:

Hello John, you got in this test.
Comments
- comment 1
Best,
Me

I expect to get the number in the sentence "you got 10.8 in this test."

The problem exists even if the numbers are quoted, even if it is just an integer. More over, if I have two records in my csv file:

email,name,score,comments
"a@b.c","John",10.8,"<ul><li>comment 1</li></ul>"
"x@y.z","Juan", "a 10.8","<ul><li>comment 2</li></ul>"

I get the blank behavior for John, but the mail of Juan gets the correct sentence "you got a 10.8 in this test." This rules out being a problem somewhere else. It is an issue with the replacement of numbers.

Thanks

siefkenj commented 2 years ago

If you use an xlsx file, does it work?

onlycparra commented 2 years ago

I use Linux. I cannot produce xlsx files.


Apr 20, 2022 16:18:23 Jason Siefken @.***>:

If you use an xlsx file, does it work?

— Reply to this email directly, view it on GitHub[https://github.com/siefkenj/MailMerge/issues/26#issuecomment-1104544103], or unsubscribe[https://github.com/notifications/unsubscribe-auth/ABNEDAAT5A5N4FI75Q7ZWZTVGCGDZANCNFSM5T5NQ3VQ]. You are receiving this because you authored the thread. [data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD8AAAA/CAYAAABXXxDfAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAAmSURBVGiB7cEBDQAAAMKg909tDwcUAAAAAAAAAAAAAAAAAAAAJwY+QwABivJx1AAAAABJRU5ErkJggg==###24x24:true###][Tracking image][https://github.com/notifications/beacon/ABNEDAAXGRUBGTEQDIMBY43VGCGDZA5CNFSM5T5NQ3V2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIHLACZY.gif]

siefkenj commented 2 years ago

Any of the office suites can.

What about if you copy-and-paste the data into the spreadsheet?

onlycparra commented 2 years ago

Oh, I see. I'll try it later today.


Apr 20, 2022 16:49:36 Jason Siefken @.***>:

Any of the office suites can.

What about if you copy-and-paste the data into the spreadsheet?

— Reply to this email directly, view it on GitHub[https://github.com/siefkenj/MailMerge/issues/26#issuecomment-1104559061], or unsubscribe[https://github.com/notifications/unsubscribe-auth/ABNEDAD6VPT34UOC3ES2WOTVGCJY3ANCNFSM5T5NQ3VQ]. You are receiving this because you authored the thread. [data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD8AAAA/CAYAAABXXxDfAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAAmSURBVGiB7cEBDQAAAMKg909tDwcUAAAAAAAAAAAAAAAAAAAAJwY+QwABivJx1AAAAABJRU5ErkJggg==###24x24:true###][Tracking image][https://github.com/notifications/beacon/ABNEDAC2WNGXGB7XPRYUWELVGCJY3A5CNFSM5T5NQ3V2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIHLDXVI.gif]

onlycparra commented 2 years ago

Hello, @siefkenj.

Version of the plugin:

What I have tried:

I did try with xlsx and ods files, both generated by libreoffice. Here my findings.

Specific example:

I tried this file as csv, xls, xlsx and ods. The result is always the same:

email,val1,val2,val3
"decimal@a.com",1.33,2.18,3.0
"int@b.com",10,20,30
"names@c.com","one","two","three"
"quoted@d.com","100","200","300"
"spaced@e.com", 1, 2, 3

Template:

To: {{val1}} <{{email}}>
Subject: Some title
Body:
{{val1}}, {{val2}}, {{val3}}
Bye

Emails composed:

------------------
To: <decimal@a.com>
Subject: Some title
Body:
, ,
Bye
------------------
To: <int@b.com>
Subject: Some title
Body:
, ,
Bye
------------------
To: one <names@c.com>
subject: Some title
Body:
one, two, three
Bye
------------------
To: <quoted@d.com>
subject: Some title
Body:
, , 
Bye
------------------
To: <spaced@e.com>
subject: Some title
Body:
, , 
Bye
------------------

I hope this helps.

onlycparra commented 2 years ago

any news on this?

siefkenj commented 2 years ago

@onlycparra This should now be fixed in version 2.5!

onlycparra commented 2 years ago

Awesome, I just tested it with some integers. It seems to be working well. Thanks. The next coffee is on me :)